0

我对所有这些 c ++ 东西有点新手,所以这可能是初学者的问题:

列表屏幕.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_

列表屏幕.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 22在此Screen::show();调用中(出于本主题的目的,我删除了一些代码)。那么我在这里到底做错了什么?

4

1 回答 1

4

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

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

具体来说:

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

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

于 2013-12-12T18:38:45.307 回答