Code::Blocks Forums
User forums => Help => Topic started by: Decrius on November 04, 2006, 01:30:17 am
-
Hello everyone,
How can I install GLUT into code::blocks (on Windows)?
I downloaded the latest GLUT version from Nate Robins' site. It includes:
glut32.dll
glut32.lib
glut.def
glut.h
README-win32.txt
Can someone tell me where to place those files (except the txt and maybe def file), and where I have to link to in my Project > Build options > default > Linker
But in the lib folder in code::blocks libglut32.a and libglut.a already exsists. But not glut.h in the include folder...
I tried everything to get it to work last month, and nothing yet helped. I need it for the examples they have in OpenGL Programming Guide.
Thanks a lot!
Decrius
-
I keep getting this, when I include: windows.h glut.h stdio.h and all dll's and lib files I could find about opengl.
Project : OpenGL Application
Compiler : GNU GCC Compiler (called directly)
Directory : G:\Documents and Settings\Taco\Bureaublad\Coding\C\GLUT\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.cpp
Linking executable: G:\Documents and Settings\Taco\Bureaublad\Coding\C\GLUT\OpenGL.exe
.objs\main.o:main.cpp:(.text+0x1c): undefined reference to `__glutInitWithExit@12'
.objs\main.o:main.cpp:(.text+0x3d): undefined reference to `__glutCreateWindowWithExit@8'
.objs\main.o:main.cpp:(.text+0x5d): undefined reference to `__glutCreateMenuWithExit@8'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
When I don't use windows.h I get:
error: redeclaration of C++ built-in type `short'
This is really confusing ^^, does anyone else got GLUT working? How?
Decrius
-
Please google for the glut DevPak (or use the Devpak plugin of C::B). Install these libraries (they are for the MinGW compiler) to anywhere. Extend the compiler path to the folder with the header file(s). Extend the linker path to the folder with the lib (*.a). Then link against the library and everything should work. The errors you have reported are caused by missing to link against the glut library. In addition you seem to use the MS library variant of glut. Although this *might* work (I never tried) it's better to use the MinGW variant if you use the GCC compiler.
With regards, Morten.
-
YES! :D Thanks a lot man! :)
I used this site: http://mywebpage.netscape.com/PtrPck/glut.htm
And this file: http://mywebpage.netscape.com/PtrPck/glutming.zip
Its working, but only if I include the windows.h file. Is that usual?
Decrius
-
Its working, but only if I include the windows.h file. Is that usual?
Sure - you compile windows native applications when using MinGW. So there is no problem with using WinAPI.
With regards, Morten.