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 6069585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:50:17+00:00 2026-05-23T09:50:17+00:00

I’ve got a base class, and I put an abstract function in it. Now

  • 0

I’ve got a base class, and I put an abstract function in it. Now I’ve inherited from it and declared that function in my derived class. But Visual Studio still won’t compile my code and insists that the derived class is abstract. I even copied and pasted the declaration from the base class and just removed the virtual and =0 and still got the error. I’ve explicitly qualified all the arguments and return values from global scope. Any suggestions?

#include "OS/Windows/Windows.h"

#ifdef _DEBUG
#define D3D_DEBUG_INFO
#define D3DCALL(a) Wide::Render::CheckResult(a, #a)
#else
#define D3DCALL(a) a
#endif
#define D3DXFX_LARGEADDRESS_HANDLE

extern "C" {
    Wide::Render::Render* CreateRender(Wide::OSystem::Windows::WindowsOS* ptr);
}

namespace Wide {
    namespace Render {
        class D3D9Render : public Wide::Render::Render {
            friend Render* ::CreateRender(Wide::OSystem::Windows::WindowsOS*);
            D3D9Render(Wide::OSystem::Windows::WindowsOS* os);

            Wide::Colour ScreenBackground;

        public:
            Wide::Colour GetScreenBackground();
            Render* SetScreenBackground(Wide::Colour);
            void RenderFrame();

            int GetFramesPerSecond();
            std::shared_ptr<Wide::Render::Font> GetDefaultFont();
            std::shared_ptr<Wide::Render::Font> CreateFont(
                string name, 
                int weight,
                int width, 
                int height,
                bool italic
            );
        };
    }
}

The Windows header includes the Render header, the pertinent excerpt of which is posted below:

namespace Wide {
    namespace Render {
        struct Font;
        struct Label {
            virtual ::Wide::string Text() = 0;
            virtual Label* Text(::Wide::string) = 0; 

            virtual std::shared_ptr<::Wide::Render::Font> Font() = 0;
            virtual Label* Font(std::shared_ptr<::Wide::Render::Font>) = 0;

            virtual Label* Position(::Wide::Rectangle) = 0;
            virtual ::Wide::Rectangle Position() = 0;

            virtual ::Wide::Colour Colour() = 0;
            virtual Label* Colour(::Wide::Colour) = 0;

            virtual ~Label() {}
        };
        struct Font {
            virtual ::Wide::string Name() const = 0;
            virtual bool Italic() const = 0;
            virtual int Weight() const = 0;
            virtual int Width() const = 0;
            virtual int Height() const = 0;
            virtual std::unique_ptr<::Wide::Render::Label> CreateLabel() = 0;

            virtual ~Font() {}
        };
        struct Texture;
        struct Sprite {        
            virtual std::shared_ptr<::Wide::Render::Texture> Texture() = 0;
            virtual Sprite* Texture(std::shared_ptr<::Wide::Render::Texture>) = 0;

            virtual Sprite* Position(::Wide::Rectangle) = 0;
            virtual ::Wide::Rectangle Position() = 0;

            virtual ::Wide::Colour Colour() = 0;
            virtual Sprite* Colour(::Wide::Colour) = 0;

            virtual float Depth() = 0;
            virtual Sprite* Depth(float) = 0;

            virtual ~Sprite() {}
        };
        struct Texture {
            virtual ::Wide::Point Size() = 0;
            virtual ::Wide::string Filepath() = 0;

            virtual std::unique_ptr<Sprite> CreateSprite() = 0;
            virtual ~Texture() {}
        };
        struct Render {
            virtual ::Wide::Colour GetScreenBackground() = 0;
            virtual Render* SetScreenBackground(::Wide::Colour) = 0;
            virtual void RenderFrame() = 0;
            virtual int GetFramesPerSecond() = 0;

            virtual std::shared_ptr<Wide::Render::Font> GetDefaultFont() = 0;
            virtual std::shared_ptr<Wide::Render::Font> CreateFont(
                string name, 
                int weight,
                int width, 
                int height,
                bool italic
            ) = 0;

            virtual ~Render() {}
        };
    }
}

Edit: The error is extremely explicit.

d:\backups\code\projects\ngin4\d3d9render\d3d9render.cpp(9): error C2259: 'Wide::Render::D3D9Render' : cannot instantiate abstract class
          due to following members:
          'std::tr1::shared_ptr<_Ty> Wide::Render::Render::CreateFont(Wide::string,int,int,int,bool)' : is abstract
          with
          [
              _Ty=Wide::Render::Font
          ]
          d:\backups\code\projects\ngin4\ngin4\render.h(107) : see declaration of 'Wide::Render::Render::CreateFont'
  • 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-23T09:50:18+00:00Added an answer on May 23, 2026 at 9:50 am

    The windows.h defines CreateFont as CreateFontW (and many other identifiers in a similar way), resulting in many surprising compilation errors with some inclusion orders:

    #define CreateFont CreateFontW
    

    A common workaround (assuming you do not need to call this GDI function) is to undefine the symbol after including windows.h, or to avoid using names of such Win32 APIs completely.

    #undef CreateFont
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text area in my form which accepts all possible characters from
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am writing an app with both english and french support. The app requests
I'm parsing an XML file, the creators of it stuck in a bunch social
I am using Paperclip to handle profile photo uploads in my app. They upload

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.