Skip to main content
gamedev.net
🔒 Locked

strange error

Started by rcag Mar 27, 2006 at 10:06 AM 1 replies 700+ views
Original Post
rcag
rcag
hi i'm having a really strange error in my source code. i have been making a game engine for some time and i have been programming it on diferent PC's ( at home and at college) but all of a sudden the following error started appearing only in the pc at college: 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\include\GL\glut.h(146) : see declaration of 'exit' The strange thing is that it works at home and more strangelly is that the code that i've added don't make use of both glut.h and stdlib.h. i've been debugging my old code (that also stopped working at college) and i never used glut.h and stdlib.h simultaneously so the error doesn´t make sense to me. I´m programming in Microsoft Visual C++ .NET...can it be some bad configuration that someone have made on the VC++ properties? thanks for the help you can give
knowlege is power /the path to sucess has no shortcuts
Ravuya
Ravuya
I think stdlib is automatically included on MSVS's C++ compiler; you should check your linking options to make sure that you aren't accidentally linking in the GLUT libraries.
rcag
rcag
Finally i've found the error eheh


after googling for a while i found that there is an incompatibility between glut.h and visual studio.NET and the solution passes by simply including stlib.h in the project. it is a bit contradictory (because now we are really redefining the exit function) but it works.

i have seen another solution that was appending GLUT_BUILDING_LIB in the preprocesor definitions (Properties -> C/C++ -> Preprocessor -> Preprocessor definitions) but it didn´t worked for me.

knowlege is power /the path to sucess has no shortcuts

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.