#### Archived

This topic is now archived and is closed to further replies.

# Precompiler directives {SIMPLE QUESTION}

## Recommended Posts

I need to know what i am doing wrong. I have my OGLWindow class that includes gl.h Also I want to include my CBmpFont class into my main function but this class also include gl.h. Now the question is which precompiler directive do i call to eliminate the second call to #include <gl/gl.h> ? Im still here?

##### Share on other sites
GL.H has it''s own precompiler so that it is not included as many times as it is called.

open the file you should see something like
#ifndef SOMETHING_H
#define SOMETHING_H
//blah all kinds of stuff
#endif //SOMETHING_H

you could do this
#include <gl/gl.h>
#include <gl/gl.h>
#include <gl/gl.h>
#include <gl/gl.h>
#include <gl/gl.h>
#include <gl/gl.h>
#include <gl/gl.h>
and still not have a problem.

##### Share on other sites
Hey you were right, thx for the help .... hehehe

##### Share on other sites
if you are using MSVC you can use a simple pragma:
#pragma once//...//the rest of file//...

(but this is MS specific)

You should never let your fears become the boundaries of your dreams.

• ### Forum Statistics

• Total Topics
628350
• Total Posts
2982211

• 10
• 9
• 24
• 11
• 9