Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi.
I' writing a OpenGL project with C++ win32, but when i wanna using gl or glu, encounter with errors.
anyone know what am i doing?

C++
#include <GL/gl.h>
#include <GL/glu.h>
Posted
Comments
Steve Maier 2-Oct-12 11:23am    
What errors?
Richard MacCutchan 2-Oct-12 12:05pm    
Have you added the OpenGL directory to your include list in Visual Studio for the project?

1 solution

C++
#include <GL/gl.h>
#include <GL/glu.h>


will not create compilation error in VC.
Its available in <VC_Include_Path>\GL.

In my pc GL.h and GLU.h available at
<PROGRAM_FILES_PATH>\Microsoft Visual Studio\VC98\Include\GL
And you need to add opengl32.lib and GLU32.LIB in your additional libraries path.

Under Windows, you need to statically link OpenGL32.lib (note that you still link to OpenGL32.lib if you're building a 64-bit executable. The "32" part is meaningless). Visual Studio, and most Windows compilers, come with this library.


http://www.opengl.org/wiki/Getting_Started#Writing_an_OpenGL_Application[^]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900