PDA

View Full Version : openGL on dev C++



pike168
06-20-2004, 09:04 AM
i have been using dev c++ for making simple little console programs and now i want to try openGL.

I went and downloaded the openGl libraries and the glaux libraies and i tried to compile the devc++ tutorials at nehe.gamedev.net and when i tried to compile them i got lots of error messages.

has anybody here ever set up openGl using devC++ and if so could you please explain how you set it up.
i am using winXP by the way and i have a "ATI all in wonder 9200 pro" if that helps and i have dev c++ set up in my c:\ directorie, so its like c:\dev-cpp\include\GL.

BloodHound
06-21-2004, 08:03 AM
s.b. straightforward. The only wrinkle I can think of would be the order that your Dev. Studio searches header files.

Go to Tools->Options->Directories. Pull down (from the right hand side) Include Files and Library Files. Make sure the SDK is ahead of VC directories for each.

Hope that helps.

pike168
06-21-2004, 12:25 PM
ok i think i might have finally set up my devc++ compiler to run openGL files and i am using a openGL tutorial from the gametutorial.com website and its says to include the following headers:

#include <stdio.h>
#include <stdlib.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glut.h>

amd these are the only error messages i get and they have nothing to do with header files so what do the following error messages mean:

[Linker error] undefined reference to `__glutInitWithExit@12'

[Linker error] undefined reference to `__glutCreateWindowWithExit@8'

[Linker error] undefined reference to `__glutCreateMenuWithExit@8'
--------------------------------------------------------------------------------

grinsekatz
06-22-2004, 01:46 AM
i am using dev-cpp under windows xp and the nehe-tutorials. I used the libraries and headers delivered with dev-cpp 5 beta. I had to replace a library file: liblaux.a by one I downloaded from the net: glaux.lib. I copied glaux.lib into the dev-cpp/lib directory and renamed it to libglaux.a. After that I experienced no further problems.
I linked the project with libglaux.a, libglu32.a etc. (look in the nehe tutorials)I hope this helps

pike168
06-22-2004, 08:41 AM
thanks.
i downloaded openGl95.exe and when i clicked it and couple of headers and .LIB files came out, i renamed the file GLAUX.LIB to libgluax.a and put that and the other lib files that i did not already have in my lib directorie and the headers i did not have in my /lib/GL header includes.

i then included the following files:

lib/libglaux.a
lib/libglu32.a
lib/libglut32.a
lib/libglut.a
lib/libopengl32.a

in project setting and when i tried to compile i had the following error messages.

[Linker error] undefined reference to `ChoosePixelFormat@8'


[Linker error] undefined reference to `SetPixelFormat@12'


[Linker error] undefined reference to `SwapBuffers@4'

C:\Dev-Cpp\Makefile.win
[Build Error] [Project1.exe] Error 1

so now what should i do.

ZbuffeR
06-22-2004, 12:17 PM
These glut errors above means you need the # define GLUT_AT_EXIT_HACK (or whatever it is called, check the glut.h).

grinsekatz
06-23-2004, 12:26 AM
I do not think you need this glut-things. Do not include the glut headers or librarys. Just include
#include <windows.h>
#include <gl\gl.h> #include <gl\glu.h> #include <gl\glaux.h>

and link your project with OpenGL32.lib GLu32.lib and GLaux.lib (replaced one) or whatever they are called in dev-cpp/lib (i guess libopengl32.a, libglu32.a and libglaux.a

pike168
06-25-2004, 12:32 PM
where do i enter #define_glut_at_exit in my source, also i downloaded the minGW development kit and so far it feels a lot better than dev-cpp and feels a loy more like visual c++.

has anybody ever set up openGL on this software, also how do you link in this software, in devc++ all you do is add library files but in minGW i go to project>>settings>>linker and all i can do is type so what do i do.

Peter CKH
06-25-2004, 11:10 PM
Hi Guys

I am begining to use Visual C (ver 6) and opengl.
Pls advice what i need to do in order to get them working...

yooyo
06-26-2004, 01:11 AM
For all newbe quastions... nehe.gamedev.net (http://nehe.gamedev.net)

yooyo

Drag0n_Fr0G
07-02-2004, 12:00 AM
Well, guess what... I'm in the same boat, just started on the NeHe tutorials... I've gotten them to work, though. Rght click on the project icon in the sidebar, go to Project Options, and chuck this in the "Further object files..." spot:

-lopengl32 -lglaux -lglu32

And check Compile C++ Project, and Do not create a console.

Now, in around.... tutorial 6, I think, it started erroring when I compiled then executed... Try running it from the actual folder... This took me about an hour of trying to figure out the problem... then I stumbled upon the answer...