Sign in to follow this  
rcag

strange error

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this