Author Topic: Installing GLUT into code::blocks  (Read 18465 times)

Offline Decrius

  • Multiple posting newcomer
  • *
  • Posts: 81
    • Daevius
Installing GLUT into code::blocks
« 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
« Last Edit: November 04, 2006, 02:51:40 am by Decrius »
Check out my website: http://www.daevius.com

Offline Decrius

  • Multiple posting newcomer
  • *
  • Posts: 81
    • Daevius
Re: Installing GLUT into code::blocks
« Reply #1 on: November 04, 2006, 05:35:15 am »
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
Check out my website: http://www.daevius.com

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Installing GLUT into code::blocks
« Reply #2 on: November 04, 2006, 05:43:46 am »
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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Decrius

  • Multiple posting newcomer
  • *
  • Posts: 81
    • Daevius
Re: Installing GLUT into code::blocks
« Reply #3 on: November 04, 2006, 06:30:47 am »
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
Check out my website: http://www.daevius.com

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Installing GLUT into code::blocks
« Reply #4 on: November 04, 2006, 07:45:43 am »
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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ