This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Building OpenGL from source


Zieg, Mark wrote:

However, trying to link against those spat out lots of undefined
references:

 make[1]: Entering directory `/home/ziegm/opengl/teapot'
 g++ teapot.o -L/usr/X11R6/lib -lglut -lGLU -lGL -o teapot
 teapot.o:teapot.cpp:(.text+0xd2): undefined reference to
`_glClearColor@16'
 teapot.o:teapot.cpp:(.text+0xe1): undefined reference to
`_glShadeModel@4'
 teapot.o:teapot.cpp:(.text+0x11d): undefined reference to
`_glMaterialfv@12'
 teapot.o:teapot.cpp:(.text+0x159): undefined reference to
`_glLightfv@12'
 teapot.o:teapot.cpp:(.text+0x1fe): undefined reference to
`_glEnable@4'
 teapot.o:teapot.cpp:(.text+0x27c): undefined reference to
`_gluLookAt@72'
 ...etc




You don't need X11 to compile the app on cygwin, unless the app was written for X11, in which case, you really have to link against the X11 libraries.



I guess that you need to link correctly with the w32api libraries. Try these out:



g++ teapot.o /lib/w32api/libopengl32.a /lib/w32api/libglu32.a \ /lib/w32api/libgdi32.a -lm -o teapot


If you want the binary to be native windows (i.e. does not depend on cygwin), you may want to try adding the -mno-cygwin option on your invocation to g++.


HTH.

Best Regards,

Carlo

--
Carlo Florendo
Astra Philippines Inc.
www.astra.ph


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]