PDA

View Full Version : .h file



JLawson
07-07-2001, 11:26 AM
Everytime I go to compile, an error says "multiple declarations " of some crap in a required GL header file. WHAT THE HELL!!?!???

Zeus_666
07-07-2001, 09:47 PM
Hi,
As a rule of thumb never put variable declarions in a header file.
Every time you call #include "header.h", you are redeclaring any variabless in that header and this will cause your error messages.

Paul

Tim Stirling
07-08-2001, 01:22 AM
This is very tempting for begginers, "hmm, I want to have a global variable that can be used in all these different classes and cpp files, I know I will put it in a header and include this in all the files."

Tron
07-08-2001, 02:22 AM
u wrote
#include "GL/gl.h"
right?

u use windoze, right?

u MUST include "windows.h" right before including "gl.h":

#include "windows.h"
#include "GL/gl.h"

hope that helps (;