小编Atr*_*rus的帖子

c ++中对class :: function的未定义引用

当我尝试调用OnLoop时,我收到错误,它无法识别它.

///Ins_App.h

#ifndef INS_APP_H
#define INS_APP_H

#include <SDL/SDL.h>

class Ins_App
{
    private:
        /*   Variables   */
        bool Running;
        SDL_Surface* Surf_Display;

    public:
        /*  inMain  */
        Ins_App();
        int OnExecute();

    public:
        /*  Other   */

        bool OnInit();
        void OnEvent(SDL_Event* Event);
        void OnLoop();
        void OnRender();
        void OnCleanup();

    protected:
};

#endif // INS_APP_H
Run Code Online (Sandbox Code Playgroud)

///Ins_App.cpp

#include "Ins_App.h"

Ins_App::Ins_App()
{
    Running = true;
    Surf_Display = NULL;
}

int Ins_App::OnExecute(){

    if(OnInit() == false){
        return -1;
    }
    SDL_Event Event;
    while(Running){
        while(SDL_PollEvent(&Event)){
            OnEvent(&Event);
        }
        OnLoop();
        OnRender();
    }
    return 0;
}

int main(int …
Run Code Online (Sandbox Code Playgroud)

c++ class function linker-errors

0
推荐指数
1
解决办法
4346
查看次数

标签 统计

c++ ×1

class ×1

function ×1

linker-errors ×1