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

  • Home
  • SEARCH
  • 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 6934215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:55:52+00:00 2026-05-27T11:55:52+00:00

How is the following class Game abstract? And how do I make it concrete

  • 0

How is the following class Game abstract? And how do I make it concrete so I can create an instance of it?

game.h

#include <JApp.h>
#include <JGE.h>

class Game: public JApp
{    
private: 
    JGE* Engine;
    int x, y, x2, y2;
public:
    Game(JGE *engine);
    virtual ~Game();
    virtual void Create();
    virtual void Destroy();
    virtual void Update();
    virtual void Render();
};

main.cpp

//Other headers
#include "game.h"
int main(void)
{
    JGE* engine = NULL;
    SetupCallbacks();
    engine = JGE::GetInstance();
    engine->printf("Starting Game!");
    Game* g = new Game(engine); // Error 'Game is an abstract type 
    engine->SetApp(g);
    engine->Run();
    engine->Destroy();

    sceKernelExitGame();
}

Game::Game(JGE* engine) : JApp(engine)
{
    Engine = engine;
    x = 0;
    x2 = 100;
    y = 0;
    y2 = 100;
}
void Game::Update()
{
    if (this->Engine->GetButtonClick(PSP_CTRL_UP))
    {
        x2 += 1;
        y2 += 1;

    }
    else if(this->Engine->GetButtonClick(PSP_CTRL_DOWN))
    {

        y2 += 10;
        y += 10;
    }
}
void Game::Create()
{    
}
void Game::Render()
{
     JRenderer* renderer = JRenderer::GetInstance();
     renderer->DrawLine(x, y, x2, y2, ARGB(0, 0, 0, 255));
}
Game::~Game()
{       
}
void Game::Destroy()
{   
}

P.S. Any explanation will be helpful since I am not an expert in object-oriented programming.

Here is the error message together with some other stuff:

1>------ Build started: Project: PSP Pong, Configuration: Debug Win32 ------
1>  psp-g++ -I. -Ic:/pspsdk/psp/sdk/include -O2 -G0 -Wall  -I. -Ic:/pspsdk/psp/sdk/include -O2 -G0 -Wall  -fno-exceptions -fno-rtti -D_PSP_FW_VERSION=150   -c -o main.o main.cpp
1>  main.cpp: In function 'int main()':
1>main.cpp(57): error : cannot allocate an object of abstract type 'Game'
1>  game.h (5) : note:   because the following virtual functions are pure within 'Game':
1>  c:/pspsdk/psp/sdk/include/JApp.h (78) : note:   virtual void JApp::Pause()
1>  c:/pspsdk/psp/sdk/include/JApp.h (84) : note:   virtual void JApp::Resume()
1>  main.cpp: In constructor 'Game::Game(JGE*)':
1>main.cpp(66): error : no matching function for call to 'JApp::JApp(JGE*&)'
1>  c:/pspsdk/psp/sdk/include/JApp.h (26) : note: candidates are: JApp::JApp()
1>  c:/pspsdk/psp/sdk/include/JApp.h (22) : note:                 JApp::JApp(const JApp&)
1>  c:\pspsdk\bin\make: *** [main.o] Error 1
1>  Press any key to continue . . . 
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "c:\pspsdk\bin\vsmake.bat" exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  • 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-27T11:55:53+00:00Added an answer on May 27, 2026 at 11:55 am

    JApp has pure virtual functions you must implement in your class. Since you have not implemented them, your class is incomplete.

    Sample to illustrate the problem:

    struct B
    {
        // this function is pure-virtual and
        // must be implemented in order to instantiate
        virtual void fn() = 0;
    };
    
    struct C : public B
    {
        // missing implementation of fn().
        // as of now, this class is abstract because fn()
        // has no definition.
    };
    
    ...
    
    // try to instantiate...
    C myobj;// this line produces error C2259: 'C' : cannot instantiate abstract class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following code : public class Game { private Map<String,Coordinate> m_myHashMap; ... //
I have a class with the following declaration of the fields: public class Game
Assume the following class: public class MyEnum: IEnumerator { private List<SomeObject> _myList = new
I defined the following Sound Class to play Sound in my Pacman Game: public
Imagine the following two classes of a chess game: TChessBoard = class private FBoard
I've create the following class in Visual Studio 2010: public class Bat : Form1
i have the following: a game class class Game { public event EventHandler GameOver;
I have a class called Console, with the following structure: public Console(Game game) {
I have the following class: #ifndef CGE_NET_MESSAGE_PARSER_HPP #define CGE_NET_MESSAGE_PARSER_HPP #include Game/platform.hpp #include <vector> #include
I have the following object: public partial class Game { public bool Finished {

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.