Consider the following program and try to compile it under Cygwin:
#include <GL/glut.h> int main(int argc, char** argv) { glutInit(&argc, argv); glLoadIdentity(); }
It compiles and works fine. -I/usr/include/opengl seems very important.
g++ -I/usr/include/opengl -I../include/cygwin -L../lib/cygwin test.cpp -o test.exe -lglut32 -lglu32 -lglew32 -lopengl32
Now,
#include <GL/glew.h> // from newest NVIDIA SDK #include <GL/glut.h> int main(int argc, char** argv) { glewInit(); glutInit(&argc, argv); glLoadIdentity(); }
compiled
g++ -I/usr/include/opengl -I../include/cygwin -L../lib/cygwin test.cpp -o test.exe -lglut32 -lglu32 -lglew32 -lopengl32
fails. How to create a second application?
First
There are several ways to create glew from the NVIDIA SDK: VS, by cywin, using cygwin with -D_WIN32. I also tried the cygwin compilation from the original source from source.
VS build gives
/cygdrive/c/DOCUME~1/kelebron/LOCALS~1/Temp/ccErbecl.o:test.cpp:(.text+0xa8): undefined reference to `_glLoadIdentity' collect2: ld returned 1 exit status
cygwin build give a lot
../lib/cygwin/glew32.lib(glew.o):glew.c:(.text+0x38e): undefined reference to `_glXGetProcAddress'
and cygwin with -D_WIN32 does not compile at all (I was slightly motivated by this post ).
Second
There seem to be two ways to communicate with OpenGL
with -L / lib / w32api
or with -L / usr / X11R6 / lib -lX11 -lXi -lXmu
But, the -L directives do not change anything. I have / usr / lib / w 32api / libopengl32.a, but the version of X11 may be missing (/ usr / X11R6 / lib / libGL?). Which package should I include in Cygwin? I installed everything starting with libGL (not only ...).
kelebron
source share