Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 849931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:10:55+00:00 2026-05-15T07:10:55+00:00

I checked out a post similar to this but the linkage was different the

  • 0

I checked out a post similar to this but the linkage was different the issue was never resolved. The problem with mine is that for some reason the linker is expecting there to be a definition for the base class, but the base class is just a interface. Below is the error in it’s entirety

c:\users\numerical25\desktop\intro todirectx\godfiles\gxrendermanager\gxrendermanager\gxrendermanager\gxdx.h(2) : error C2504: 'GXRenderer' : base class undefined

Below is the code that shows how the headers link with one another

GXRenderManager.h

#ifndef GXRM
#define GXRM
#include <windows.h>
#include "GXRenderer.h"
#include "GXDX.h"
#include "GXGL.h"

enum GXDEVICE {
    DIRECTX,
    OPENGL
};

class GXRenderManager {
public:
    static int Ignite(GXDEVICE);

private:
    static GXRenderer *renderDevice;

};

#endif

at the top of GxRenderManager, there is GXRenderer , windows, GXDX, GXGL headers. I am assuming by including them all in this document. they all link to one another as if they were all in the same document. correct me if I am wrong cause that’s how a view headers. Moving on…

GXRenderer.h

class GXRenderer {

public:
    virtual void Render() = 0;
    virtual void StartUp() = 0;

};

GXGL.h

class GXGL: public GXRenderer {

public:
    void Render();
    void StartUp();
};

GXDX.h

class GXDX: public GXRenderer {
public:
    void Render();
    void StartUp();
};

GXGL.cpp and GXDX.cpp respectively

#include "GXGL.h"

void GXGL::Render()
{

}

void GXGL::StartUp()
{

}

//...Next document

#include "GXDX.h"


void GXDX::Render()
{

}

void GXDX::StartUp()
{

}

Not sure whats going on. I think its how I am linking the documents, I am not sure.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T07:10:56+00:00Added an answer on May 15, 2026 at 7:10 am

    The problem is You need to have #include "GXRenderer.h" at the top of both: GXGL.h and also GXDX.h.

    The base type must be defined not just declared before defining a derived type.

    By the way, the error is a compiling error not linking error.

    Edit: About your class type redefinition:

    at the top of every header file you should have #pragma once.

    The #pragma once directive specifies that the file will be included at most once by the compiler in a build.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A similar problem to mine is in this thread , but it doesn't use
In this post , I found out that it was possible to create individual
I checked some other similar questions but some of them are old and i'm
I checked out the three20 source and was trying to follow this guide to
I recently checked out a large C# code base that I will be doing
When updating my checked out directory with TortoiseSVN, some subfolders are listed as Skipped
I have checked out now a local working copy of a codebase that lives
Sorry to post another question that is similar to the question that I posted
How do I load a MOV file into Flash 9 I checked this post
I read a similar post from someone who was having trouble figuring out where

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.