eclipse - The moment I add glew.h in my code glut related errors start appearing -


i new c/c++ environment setup. right using eclipse ide. below steps have followed after installing mingw , running basic helloworld, c program 1) copied glew32.dll , glut32.dll "c:\mingw\bin" 2) copied gl.h, glew.h, glu.h , glut.h "c:\mingw\include\gl" 3) copied glew32.lib, glut32.lib , opengl32.lib "c:\mingw\lib" 4) in project->properties->c/c++ build->settings->tool settings->mingw c linker->libraries(-l) added "glew32", "glut32","glu32" , "opengl32" 5) copied below code

compiles properly.

the moment uncomment first line, ie glew.h, glut related compile errors (added below) appear, can 1 tell me going wrong during setup?

//#include <gl/glew.h> #include <gl/gl.h> #include <gl/glut.h>  void changeviewport(int w, int h) {     glviewport(0, 0, w, h); }  void render() {     glclear(gl_color_buffer_bit | gl_depth_buffer_bit);     glutswapbuffers(); }   int main(int argc, char** argv) {     glutinit(&argc, argv);      glutinitdisplaymode(glut_double | glut_rgba | glut_depth);     glutinitwindowsize(800, 600);     glutcreatewindow("pinnen best");     glutreshapefunc(changeviewport);     glutdisplayfunc(render);     glutmainloop();     return 0; }   description resource    path    location    type undefined reference `__glutcreatemenuwithexit'   opengl      line 549, external location: c:\mingw\include\gl\glut.h c/c++ problem undefined reference `__glutcreatewindowwithexit' opengl      line 503, external location: c:\mingw\include\gl\glut.h c/c++ problem undefined reference `__glutinitwithexit' opengl      line 486, external location: c:\mingw\include\gl\glut.h c/c++ problem undefined reference `glutdisplayfunc'    opengl.c    /opengl/src line 25 c/c++ problem undefined reference `glutinitdisplaymode'    opengl.c    /opengl/src line 21 c/c++ problem 

//ignore

from glew webpage [delete gl include] :

using glew shared library

in program:

#include <gl/glew.h> #include <gl/glut.h> <gl, glu, , glut functionality available here> 

or:

#include <gl/glew.h> <gl , glu functionality available here> 

remember link project glew32.lib, glu32.lib, , opengl32.lib on windows , libglew.so, libglu.so, , libgl.so on unix (-lglew -lglu -lgl). important keep in mind glew.h includes neither windows.h nor gl.h. also, glew warn issuing preprocessor error in case have included gl.h, glext.h, or glati.h before glew.h.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -