GLUT Problems

Started by
5 comments, last by awesty 16 years, 2 months ago
I have just started reading 'Beginning OpenGL Game Programming' and I tried to build the first example but got this error: fatal error C1083: Cannot open include file: 'glut.h': No such file or directory c:\cpp\opengl\simple\simple.cpp 2 So I tried building GLUT 3.7.6 but I got this error: Error 16 error PRJ0019: A tool returned an error code from "Copying libraries, headers & dll's..." glut32 And these warnings: Warning 1 warning C4996: 'strtok' was declared deprecated c:\documents and settings\awesomo\local settings\temp\glut-3.7.6-src\glut-3.7.6\lib\glut\glut_dstr.c 1216 Warning 2 warning C4996: 'strtok' was declared deprecated c:\documents and settings\awesomo\local settings\temp\glut-3.7.6-src\glut-3.7.6\lib\glut\glut_dstr.c 1219 Warning 3 warning C4996: 'strcpy' was declared deprecated c:\documents and settings\awesomo\local settings\temp\glut-3.7.6-src\glut-3.7.6\lib\glut\glut_dstr.c 1230 Warning 4 warning C4996: 'strtok' was declared deprecated c:\documents and settings\awesomo\local settings\temp\glut-3.7.6-src\glut-3.7.6\lib\glut\glut_dstr.c 1241 Warning 5 warning C4996: 'strtok' was declared deprecated c:\documents and settings\awesomo\local settings\temp\glut-3.7.6-src\glut-3.7.6\lib\glut\glut_dstr.c 1249 Warning 6 warning C4996: 'strtok' was declared deprecated c:\documents and settings\awesomo\local settings\temp\glut-3.7.6-src\glut-3.7.6\lib\glut\glut_gamemode.c 514 Warning 7 warning C4996: 'strtok' was declared deprecated c:\documents and settings\awesomo\local settings\temp\glut-3.7.6-src\glut-3.7.6\lib\glut\glut_gamemode.c 517 Warning 8 warning C4996: 'strcpy' was declared deprecated c:\documents and settings\awesomo\local settings\temp\glut-3.7.6-src\glut-3.7.6\lib\glut\glut_gamemode.c 528 Warning 9 warning C4996: 'strtok' was declared deprecated c:\documents and settings\awesomo\local settings\temp\glut-3.7.6-src\glut-3.7.6\lib\glut\glut_gamemode.c 531 Warning 10 warning C4996: 'strtok' was declared deprecated c:\documents and settings\awesomo\local settings\temp\glut-3.7.6-src\glut-3.7.6\lib\glut\glut_gamemode.c 539 Warning 11 warning C4996: 'getenv' was declared deprecated c:\documents and settings\awesomo\local settings\temp\glut-3.7.6-src\glut-3.7.6\lib\glut\glut_mesa.c 34 Warning 12 warning C4996: 'strcpy' was declared deprecated c:\documents and settings\awesomo\local settings\temp\glut-3.7.6-src\glut-3.7.6\lib\glut\glut_util.c 27 Warning 13 warning C4996: 'strdup' was declared deprecated c:\documents and settings\awesomo\local settings\temp\glut-3.7.6-src\glut-3.7.6\lib\glut\win32_menu.c 410 Warning 14 warning C4996: 'strdup' was declared deprecated c:\documents and settings\awesomo\local settings\temp\glut-3.7.6-src\glut-3.7.6\lib\glut\win32_menu.c 449 Warning 15 warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored c:\Documents and Settings\Awesomo\Local Settings\Temp\glut-3.7.6-src\glut-3.7.6\lib\glut\glut.def 1 What am I doing wrong?
Advertisement
Instead of building GLUT, you should just take the already built binaries and just link the sample application to them.

The warning that you are getting are coming from either the 2005 or 2008 version of MS Visual Studio. The warnings indicate that the functions that have been specified will at some point no longer be apart of the API. You should be ok to ignore those warnings, since I doubt that MS will be removing them from the standard C library. I am sure others can comment on this better than I have. Hope this helps.
The error, C1083 mean the compiler cannot find "glut.h". Please check the location of "glut.h".

Others are just warnings. I agree with "Deception666". Those standard string functions cannot be deprecated. It is one of annoying warnings generated by MS VC++.

You can ignore them, or, disable the warnings by putting the following at the beginning of the file;
#pragma warning(disable: 4996)

Or add the following option in VC compiler command line property page;
/D "_CRT_SECURE_NO_DEPRECATE"
When using VS* check that you specified:
Additional Include Directories
Additional Library Directories
and
Additional Dependencies

when you are using the dynamic link libraries than copy the dlls into the debug and release folder of your project or into windows/system32/(dllhell)
So when it says cannot open include file 'gl\glut.h' where should the file be on my harddrive?
It depends on where your have your Windows SDK files installed, I have mine installed to G:\Microsoft Platform SDK, so my glut.h is in G:\Microsoft Platform SDK\Include\gl. Is it possible you don't even have the Windows SDK installed? I know that the free version of VS2005 requires you to install it manually.
I feel so stupid know. I have gotten it working fine. Thanks for your help. :)

This topic is closed to new replies.

Advertisement