Jump to content
  • Advertisement

Archived

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

OverGround

Precompiler directives {SIMPLE QUESTION}

This topic is 5374 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!