C++ – Problem linking when using stl in VS2005

linkerstlvisual c++visual-studio-2005

I just added STL usage to some code, and I'm getting this link error:

error LNK2019: unresolved external symbol "public: __thiscall std::_Lockit::~_Lockit(void)"

I must be missing something in the link, I've done this before – and googling has not helped so far. hmm……

Here's the code snippet:

#pragma once
#include "Observer.h"
#include <list>

class NGE_Observable
{
public:
    Observable(void);
    virtual ~Observable(void);
    void    RegisterObserver(Observer *pObserver, void *user);
    void    UnRegisterObserver(Observer *pObserver);
    void    NotifyObservers();

private:
    std::list<Observer *>    observers;
};

Answered!: Operator error – duh. I had set the project properties to ignore all default libraries, so the stl library was not being linked. I was confused since I only got one error message, but as I added stl calls, the link errors increased.

Best Answer

One possible reason is that you declared your destructor for class _Lockit, but you didn't implement it.

Is _Lockit implemented by you?

LATER EDIT: Does this help you?

Related Topic