OpenGL wrapper class problems [Archive] - C Board

PDA

View Full Version : OpenGL wrapper class problems


...
10-24-2003, 06:48 PM
ive been working on a wrapper class for OpenGL, and i got it pretty much how i want it, but when i compile i get a million re-definition errors that all point back to gl.h. it looks like a multiple include, but i am only including the OGL headers in one file in my program.

the headers for the only 3 files in my program look like this:


//Main.cpp

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "resource.h"

#include "oglDisplay.h"



// oglDisplay.h

#ifndef _OGLDISPLAY_H_
#define _OGLDISPLAY_H_

#include "gl/gl.h"
#include "gl/glu.h"

//...

#endif



// oglDisplay.cpp

#include "oglDisplay.h"



if you need any more code than that to deduce the problem, let me know.

jverkoey
10-25-2003, 12:28 AM
your gl includes should be <gl/gl.h>, unless you actually have the gl includes in your project space (which would be kinda weird)

also, there shouldn't be any redefs with the GL headers, as everything in there should already be tested for...........could you post an example of one of the redef errors?

...
10-25-2003, 01:31 AM
i fixed the quotes to angle brackets (stupid mistake, i dont know what i was thinking), but that didnt fix my problem.

my errors go something like this

int "APIENTRY" redefinition
50x
int "WINGDIAPI" redefinition
50x
void should be preceeded by ';'
50x
etc...

the 50x is arbitrary, but it says it once for every time APIENTRY and WINGDIAPI are mentioned in the header. all of these errors point to gl.h.

...
10-25-2003, 04:28 PM
i fixed it by moving my #include <windows.h> into the oglDisplay.h above the OpenGL includes.

anyone know why this causes problems?