Help with library .a -> .lib in glut!!!

hello.
Ive installed MinGw under windows (its like cygwin, for those who do not know what it is) and iam using it to compile C/C++ code. The problem is that iam using GLUT and when i compile the .o files i get undefined reference to all glut functions! i think the problem is that its not using the file glut32.lib cause mingw uses .a files for a library… how cant i correct this? is there a version of glut with .a files for library?

JML

Hi !

First of all cygwin is an emulation layer for unix, so it tries to emulate unix on Windows, MinGW on the other hand is not a unix emulation layer, it’s actually run on Microsoft’s msvcrt library, just wanted to point that out.

If you have a modern installation of MinGW you should be able to use .lib files without any problems.

Mikael

I use DEV-C IDE which comes with the mingw compiler.

Now DEV-C (FREE GUI interface) comes with all the openGL library files in .a format, including glut.

When compiling are you linking the librarys.

-lopengl32 -lglu32 -lglut32

look in the lib directory for the following files:

libopengl32.a
libglu32.a
libglut32.a

If you don’t have them drop me an e-mail and I will send what ever file you need.

Originally posted by dögun:
[b]hello.
Ive installed MinGw under windows (its like cygwin, for those who do not know what it is) and iam using it to compile C/C++ code. The problem is that iam using GLUT and when i compile the .o files i get undefined reference to all glut functions! i think the problem is that its not using the file glut32.lib cause mingw uses .a files for a library… how cant i correct this? is there a version of glut with .a files for library?

JML [/b]

lol, each time u answer something nice =)) ive searched for that DEV-C IDE but i havent found it, is it in the http://www.mingw.org home site??

found it, thanks to both, ill try to continue =)

Now i get undefined reference to __gxx_personality_v0 !!! have no idea what this is…

Compiling with:

gcc -o $(exec) $(objects) -L -lglu32 -lglut32 -lopengl32

ok for i was missing the -lstdc++ flag, no idea what it does, but it works. Thanks people

Here is the link for DEV-C++
http://www.bloodshed.net/devcpp.html

Also on my website have how to set it up:
www.angelfire.com/linux/nexusone/

Originally posted by dögun:
lol, each time u answer something nice =)) ive searched for that DEV-C IDE but i havent found it, is it in the http://www.mingw.org home site??

[This message has been edited by nexusone (edited 05-21-2003).]

Hi !

If you use g++ instead of gcc when you compile it will work without the flag (g++ does it for you)

Mikael