繁体   English   中英

调用父母的方法

[英]Calling parent's method

我是所有这些C ++的新手,所以这可能是初学者的问题:

ListScreen.h

#ifndef _LISTSCREEN_H_
#define _LISTSCREEN_H_

#include "MAUI/Screen.h"

namespace CoolPlaces {
    namespace Views {
        using namespace MAUI;

        class ListScreen : public Screen {
            public:
                ListScreen();
                ~ListScreen();

                void keyPressEvent(int keyCode, int nativeCode) {}
                void keyReleaseEvent(int keyCode, int nativeCode) {}
                void pointerPressEvent(MAPoint2d point) {}
                void pointerReleaseEvent(MAPoint2d point) {}
                void pointerMoveEvent(MAPoint2d point) {}
                void show();
        };
    }
}

#endif    //_LISTSCREEN_H_

ListScreen.cpp

  #include "MAUI/Screen.h"
#include "ListScreen.h"

using namespace MAUI;
using namespace CoolPlaces::Views;

void ListScreen::show() {
    Screen::show();
};

我收到此错误: D:\\MosyncProjects\\Views\\ListScreen.cpp:22: Error: Unresolved symbol '__ZN4MAUI6Screen4showEv' line 22Screen::show(); D:\\MosyncProjects\\Views\\ListScreen.cpp:22: Error: Unresolved symbol '__ZN4MAUI6Screen4showEv' line 22 Screen::show(); 调用(出于本主题的目的,我删除了一些代码)。 那我到底在做什么错?

您将包括头文件,该头文件告诉函数Screen::show()存在,但可能不链接具有实现的库。

看到此页面: http : //www.mosync.com/docs/sdk/cpp/guides/libs/working-with-mosync-libraries/index.html

特别:

除了在应用程序代码中引用头文件之外,还需要指定要在项目的“构建设置”中使用的实际库(“项目”>“属性”> MoSync项目>“构建设置”):

看起来maui.lib应该包含屏幕代码。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM