|
From: Chris S. <csh...@qu...> - 2006-03-22 13:14:25
|
Hi, I've managed to fix the compile problem I was having with GLUT. I found the following email which suggests that there is a problem with the latest version of GLUT (3.7.6) and the libraries included with MinGW. > I was mentioning earlier the oddity of having the glut libraries > libglut.a, libglut32.a, but not the header glut.h, in the mingw package. > I think it would be not only painless, but also really nice if you could > just add the header to the package! > > I was curious why I needed to do a certain hack on the latest glut.h > (specifically, to remove some prototypes that the linker expects and > dies when it doesn"t find them in libglut32.a). > Eventually, I realized that libglut.a and libglut32.a currently supplied > with mingw belong to an older version, i.e. 3.6 (latest stable) instead > of 3.7.6 (late beta). That version works with mingw, without needing any > patch. > > So I suggest to include glut.h from glut-3.6: > http://www.opengl.org/developers/documentation/glut/ > http://www.opengl.org/developers/documentation/glut/glutdlls36.zip > into: > /mingw/include/GL/ > > > The nicest part is that it works unmodified with mingw, and even with > cygwin if -DWIN32 is passed to the cygwin-gcc cmd line. > > As a side note (related to the first _M_IX86 message in its thread), > this is a version that does include <windows.h>, unlike the newer ones. > At least it"s good that it *works*. > > > My tests show that the executables run well with GLUT32.DLL from 3.6 > to 3.7.6. To test it yourself, you should find plenty of test programs. > But if you are in a hurry, you can get a very basic one from here: > http://www.cs.toronto.edu/~cosmin/test/teapot.c > In case you wonder about the cmd line: > gcc -oteapot teapot.c -lglut32 -lglu32 -lopengl32 > > > Best regards, > Cosmin Cheers, Chris Chris Share wrote: > Thanks! > > Just to be clear about this, what you're saying means the problem is > that libglut32.a does not "match" glut32.dll--is that correct? > > Cheers, > > Chris > > Michael Gerdau wrote: > >>> I tried the following: >>> >>> c:\programming\c++\g++> g++ Test.cpp -o Test.exe -lglut32 >>> C:\DOCUME~1\CHRIS~1.LAP\LOCALS~1\Temp/ccaecaaa.o(.text+0x11c):Test.cpp: >>> undefined reference to `__glutInitWithExit@12' >>> C:\DOCUME~1\CHRIS~1.LAP\LOCALS~1\Temp/ccaecaaa.o(.text+0x13d):Test.cpp: >>> undefined reference to `__glutCreateWindowWithExit@8' >>> C:\DOCUME~1\CHRIS~1.LAP\LOCALS~1\Temp/ccaecaaa.o(.text+0x15d):Test.cpp: >>> undefined reference to `__glutCreateMenuWithExit@8' >>> collect2: ld returned 1 exit status >>> Process g++ exited with code 1 >>> >>> However the output was the same. >>> >>> Any other ideas? >> >> >> >> In your previous post you had the problem thet libglut32.a had not >> been found by the linker. The above output shows that this problem >> is solved by the change of name (-llibglut32 -> -lglut32). >> >> However now you get honest undefined references which in turn means >> the library does not provide the functions you are using (from the >> linker point of view). >> >> I don't know libglut32.a but I'd suspect either the corresponding >> header use the wrong declarations or the (import?) library does >> use the wrong naming (e.g. one too many leading '_', stdcall when >> it shouldn't or whatever). >> >> Googleing for 'libglut32\.a' does provide this URL: >> http://www.cygwin.com/ml/cygwin/1998-12/msg00530.html >> >> HTH, best, >> Michael > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > |