Sign in to follow this  

Linker error LNK2019

Recommended Posts

When I try to compile my project I get this:
SdlWrapper.obj : error LNK2019: unresolved external symbol "public: static void __cdecl Log::Write(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?Write@Log@@SAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: bool __thiscall SdlWrapper::SetRes(int,int,int)" (?SetRes@SdlWrapper@@QAE_NHHH@Z)
Debug/TicTacToe.exe : fatal error LNK1120: 1 unresolved externals

Log is a logging class I have. And SdlWrapper is... well a wrapper for sdl. :P Other than that, I dont really know what wrong or where to look.

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
Somewhere, though, you should have it defined as a function prototype.

I don't know C++ (C only) so I don't know what the :: are - something to do with inheritance maybe - but you should have something like (overly complex example, so as to demonstrate the problem):

void Log::Write(const string& logEntry);

Somewhere, as a definition of the function. If it's external (won't be available to the C++ compiler, but will be to the linker - say an assembler function or something already compiled to object code) then you'll need something like:

extern void Log::Write(const string& logEntry);

As I say, I don't know C++ at all, so the syntax in terms of those :: might be different.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this