这是我的代码:
menuState.hpp
#ifndef MENU_STATE_HPP
#define MENU_STATE_HPP
#include "state.hpp"
#include <SFML/Graphics.hpp>
class MenuState : public State
{
public:
MenuState();
static void create(StateListener* Parent, const std::string name)
{
MenuState* myState = new MenuState();
myState->parent = Parent;
Parent->manageState(name, myState);
}
void enter();
void exit();
void resume();
private:
};
#endif // MENU_STATE_HPP
Run Code Online (Sandbox Code Playgroud)
当我这样做时,我得到一个未定义的构造函数引用MenuState* myState = new MenuState();,我不确定为什么因为MenuState :: MenuState()在类声明中的create函数之前.
编辑:我也得到了所有我的sfml函数相同的错误.
这是确切的构建消息:http://pastebin.com/e819FhPj
我确实链接了sfml库,并在我的编译器搜索目录中设置了标题路径.