Showing posts with label Linker issues. Show all posts
Showing posts with label Linker issues. Show all posts

Wednesday, February 24, 2010

Can't link your library...?

Do you have new class and for forgot to fully implement it...?

e.g.
you have an error like this

MyLib.lib(MyClass.obj) : error LNK2001: unresolved external symbol "public: virtual long __stdcall MyNamespace::MyClass::SomeMethod(...)

MyClass.h declares
void SomeMethod();

and in
MyClass.cpp

you only put
void SomeMethod()
{
}

Looks okay, doesn't it?

it is close, but needs the class name for scope resolution
i.e.
void MyClass::SomeMethod()
{}