Advertisement Jump to content
Sign in to follow this  

Loopy linking

This topic is 3946 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

Right, I've decided I really, really, REALLY hate the C++ preprocessor, and might just go and write my next code in D, but that's not the problem. I'm using a couple of renderer classes called I_Renderer and OGLRenderer, which derives from I_Renderer. They are in the mglGraphics.h file, which is included in one slightly monolithic header, called locus_main.h (I'll show it in a minute) which each header and each source file includes, like so;
#ifndef LOCUS_MAIN_H
#define LOCUS_MAIN_H

#include <windows.h>
#include <cmath>


// misc
#include <error.h>
#include <mglFile.h>
#include <mglSingleton.h>
#include <mglTime.h>
#include <mglResourceManager.h>

// OS dependant
#include "mglWindow.h"
#include "mglInput.h"

// math
#include "locus_math.h"
#include "frustum.h"

// graphics
#include <gl/gl.h>
#include "texture.h"
#include "mglGraphics.h"
#include "level.h"

    // graphics constants
    /*const Engine::RGBA_COL RGB_BLACK(0.0f);
    const Engine::RGBA_COL RGB_WHITE(1.0f);*/

#include "physics.h"

// sound
#include "sound.h"

// scene
#include "scene_entity.h"
#include "scene_graph.h"
#include "scene.h"

// the application class to wrap all of the above
#include "locus_application.h"

#endif // LOCUS_MAIN_H

and the mglGraphics.h
#ifndef H_GRAPHICS
#define H_GRAPHICS

#include "locus_main.h"

#include <windows.h>
#include <gl/gl.h>
#include <cmath>

namespace Engine

class I_Renderer

class OGLRenderer:public I_Renderer


Now, when I try;

#include "locus_main.h"

class App
        Engine::Window m_wnd;
        Engine::mglInput* m_input;
        Engine::mglTime m_timer;
        Engine::OGLRenderer* render;


        virtual void Init();
        virtual void Go();

        virtual ~App(){}


and compile, I'm told
locus_application.h:11: error: using-declaration for non-member at class scope
locus_application.h:11: error: expected `;' before '*' token
:: === Build finished: 2 errors, 0 warnings ===
Does anyone have any ideas, as I'm completely stumped

Share this post

Link to post
Share on other sites
Excellent, thanks. It appears rip-offs link was what I was looking for, but thank you Antheus, as well, for the prompt reply

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!