Jump to content
  • Advertisement
Sign in to follow this  
rcag

strange error

This topic is 4441 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!