PDA

View Full Version : I can't compile in Dev-C++



mi-go
11-23-2006, 01:18 PM
Hi all,

I have the book "OpenGL Superbible" and I can't compile any example in Dev-C++.

I have compiled other examples that are not of that book, the programs use:
#include "glos.h"
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glaux.h>

I put "-lopengl32 -lglaux -lglu32" in linker options and I have no problem to compile it.


But SuperBible's examples use (for expample):
#include "Common/OpenGLSB.h" // System and OpenGL Stuff
#include "Common/GLTools.h" // OpenGL toolkit

And I cant compile it.

I have put all the files in the Dev-C++ Directories, and the entire "Common" directory that have the Superbible's GLTools, but I cant make it runs.

It gave me errors like this:
4152 c:\dev-c_~1\include\common\glext.h
redefinition of `PFNGLCOLORSUBTABLEEXTPROC'

1493 c:\dev-c_~1\include\gl\gl.h
`PFNGLCOLORSUBTABLEEXTPROC' previously declared here

503 c:\dev-c_~1\include\common\wglext.h
parse error before `INT32'

504 c:\dev-c_~1\include\common\wglext.h
warning: `__stdcall__' attribute directive ignored

504 c:\dev-c_~1\include\common\wglext.h
parse error before `INT64'

504 c:\dev-c_~1\include\common\wglext.h
`INT64' declared as function returning a function

505 c:\dev-c_~1\include\common\wglext.h
`PFNWGLSWAPLAYERBUFFERSMSCOMLPROC' declared as function returning a function

6 block.c
C:\DEV-C_~1\Include\Common\glext.h:415P


should i have to change linker options???

Some one help me please,
and sorry for my english, im spanish.
Thanks.

jide
11-23-2006, 01:40 PM
The errors say you that you have mistakes in your gl headers (and probably your libraries too).
Well, I suggest you try to find out GL libraries for your card (try the website of your constructor: nvidia or ati). This might be called OpenGL SDK or so.

what you most certainly have is an old GL.h header. Currently, glext.h declares the functions in which you have errors.

I'm sorry not able to help you more since it's been years I haven't done any GL stuffs under this OS. But you can try the GL wiki (here on opengl.org), it might have precious informations for the installation.

RigidBody
11-24-2006, 05:29 AM
my guess would be that glos.h includes glext, but not gl.h. in that case, changing


#include "glos.h"
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glaux.h>to


#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glaux.h>
#include "glos.h"should do the job. or maybe you just have to include windows.h first.

mi-go
11-25-2006, 03:05 AM
Thanks to all,

I did it!! :)

I update to Dev-C++ 4.9.9.2 (I was using Dev-C++ 4, that was in my CD course).

I added:
#include <windows.h>
#include <gl/gl.h>
at the begin.

And I added this linker options:
-lopengl32
-lglut32.lib
-lglut.lib
-lglu32

And now I can compile!!


I think i didnt compile beacuase the versión of the Dev-C was a little old, and the examples of the new versión of "OpenGL Superbible" are new.
But I dont know.

Anyway... thanks all ;)