Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++OpenGL
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?
 
#include <GL/gl.h>
#include <GL/glu.h>
Posted 2-Oct-12 5:00am
Comments
Steve Maier at 2-Oct-12 11:23am
   
What errors?
Richard MacCutchan at 2-Oct-12 12:05pm
   
Have you added the OpenGL directory to your include list in Visual Studio for the project?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

#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[^]
  Permalink  
v3

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 940
1 OriginalGriff 543
2 Abhinav S 253
3 thatraja 245
4 Emre Ataseven 200
0 Sergey Alexandrovich Kryukov 8,282
1 OriginalGriff 4,750
2 Peter Leow 3,784
3 Maciej Los 3,515
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 3 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid