Page 1 of 1

Link Errors in Visual Studio 2015

PostPosted: 15 Oct 2015, 23:03
by siremaesta
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.

Re: Link Errors in Visual Studio 2015

PostPosted: 16 Oct 2015, 10:41
by deve
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?

Re: Link Errors in Visual Studio 2015

PostPosted: 16 Oct 2015, 18:19
by siremaesta
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.

Re: Link Errors in Visual Studio 2015

PostPosted: 17 Oct 2015, 15:18
by deve
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?

Re: Link Errors in Visual Studio 2015

PostPosted: 17 Oct 2015, 19:59
by siremaesta
Awesome, it does work! Thanks a lot.