I wasn't sure where to put this - it's Visual Studio 2003 / OpenGL / GLOW specific so I guess it's up to the mods where to put it.
I started following the tutorial on GLOW and was reading about compiling it to a static library instead of using it as a source code distro and was having a problem getting it to compile.
Error(s):
Now I just thought I'd post this up incase anybody else had troubles with this. It wasn't the hardest thing to solve (just had to add a precompiler directive in glut.h) but there's always somebody out there who'll have a problem with it.Code:c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\stdlib.h(256) : error C2381: 'exit' : redefinition; __declspec(noreturn) differs c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\glut.h(152) : see declaration of 'exit'
Since I can't be bothered to upload my glut.h and link to it, here's what you need to add. Go to (Ctrl+G in VS 2003) line 145 of glut.h:
Change:Code:#if defined(_WIN32) # ifndef GLUT_BUILDING_LIB extern _CRTIMP void __cdecl exit(int); # endif # endif ...
Then just define GLOW_COMPAT_MSVCEXITHACK and it builds fine. I do it in my project properties->C/C++->Preprocessor->Preprocessor definitions field.Code:#if defined(_WIN32) # ifndef GLUT_BUILDING_LIB # if GLOW_COMPAT_MSVCEXITHACK extern _CRTIMP __declspec (noreturn) void __cdecl exit(int); # else extern _CRTIMP void __cdecl exit(int); # endif # endif ...
Just thought somebody might want to know. I'm going to see what this GLOW can do now, ciao!
EDIT: Grr, I thought I'd try and compile a Release version but it's having some link problems. Actually I'd say it's the link problem:
I haven't got the brain energy to try and get this working. I'm gonna have a shower and hit the hay. 'Night.Code:error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup



LinkBack URL
About LinkBacks


