Link Errors in Visual Studio 2015

Link Errors in Visual Studio 2015

Postby siremaesta » 15 Oct 2015, 23:03

I just downloaded the latest STK git repo and the latest dependencies project. I followed the guide here http://supertuxkart.sourceforge.net/How_to_build_the_Windows_version to the letter. I opened the project on Visual Studio 2015 and it's giving me the following linker errors:

Error LNK1120 1 unresolved externals stkirrlicht D:\Projects\GMT\INFOMOV\stk-code\bld\bin\Release\stkirrlicht.dll

Error LNK2019 unresolved external symbol "bool GLContextDebugBit" (?GLContextDebugBit@@3_NA) referenced in function "struct HGLRC__ * __cdecl irr::video::getMeAGLContext(struct HDC__ *,bool)" (?getMeAGLContext@video@irr@@YAPAUHGLRC__@@PAUHDC__@@_N@Z) stkirrlicht D:\Projects\GMT\INFOMOV\stk-code\bld\lib\irrlicht\COpenGLDriver.obj

Error LNK1181 cannot open input file 'lib\irrlicht\Release\stkirrlicht.lib' supertuxkart D:\Projects\GMT\INFOMOV\stk-code\bld\LINK

I'm a bit of a noob at this stuff, so could anyone point me in the right direction? I just get that somewhere in the irrlich project there's an undefined symbol, but I have no idea how to even start looking for it.
siremaesta
 
Posts: 3
Joined: 15 Oct 2015, 22:42

Re: Link Errors in Visual Studio 2015

Postby deve » 16 Oct 2015, 10:41

Interesting error. GLContextDebugBit variable indeed is declared as extern in irrlicht in COpenGLDriver file. But it is defined in Supertuxkart sources in glwrap.cpp file, so this error shouldn't happen:
#if DEBUG
bool GLContextDebugBit = true;
#else
bool GLContextDebugBit = false;
#endif

Did you compile ALL_BUILD project or only stkirrlicht?
deve
 
Posts: 268
Joined: 23 Jan 2014, 13:45

Re: Link Errors in Visual Studio 2015

Postby siremaesta » 16 Oct 2015, 18:19

I've compiled the ALL_BUILD project, the stkirrlicht project by itself and attempted to build the full solution. Any of those ways have resulted in the same error.
siremaesta
 
Posts: 3
Joined: 15 Oct 2015, 22:42

Re: Link Errors in Visual Studio 2015

Postby deve » 17 Oct 2015, 15:18

Which version of cmake do you use?

In your case it tries to compile shared library instead of static library (which it was always doing). And then it complains because it doesn't have GLContextDebugBit variable (it is defined in STK sources and it won't be available in dll).

I modified cmake script to make sure that we are building static library:
https://github.com/supertuxkart/stk-cod ... 0ae222c978
Could you check if it works for you?
deve
 
Posts: 268
Joined: 23 Jan 2014, 13:45

Re: Link Errors in Visual Studio 2015

Postby siremaesta » 17 Oct 2015, 19:59

Awesome, it does work! Thanks a lot.
siremaesta
 
Posts: 3
Joined: 15 Oct 2015, 22:42

Who is online

Users browsing this forum: Bing [Bot] and 1 guest