2013-12-12 4 views
0

나는 좀 물건 ++ 모든 C에 초보자, 그래서 이것은 아마도 초보자의 문제 :호출 부모의 방법

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

using namespace MAUI; 
using namespace CoolPlaces::Views; 

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

I

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 이 오류가 발생했습니다 :이 Screen::show(); 호출에 D:\MosyncProjects\Views\ListScreen.cpp:22: Error: Unresolved symbol '__ZN4MAUI6Screen4showEv' line 22 호출 (이 주제의 목적 상 일부 코드 제거). 정확히 내가 여기서 잘못하고있는거야?

+2

코드에 아무런 문제가 없습니다. 컴파일러 오류가 아니라 링커 오류입니다. 'Screen :: show()'를 정의하는 라이브러리를 링크해야한다. –

+0

젠장 ... 그럼 내가 뭘 할 수 있니? IDE를 재시작하고 컴퓨터를 재시작하십시오. 디스크 포맷? : D –

+0

'Screen :: show()'에 대한 구현을 제공하지 않았거나 객체 파일/라이브러리가있는 곳을 링크하지 않은 것 같습니다. –

답변

4

Screen::show()이라는 함수가 있지만 구현이있는 라이브러리를 연결하지 않았다고 알리는 헤더 파일을 포함하고 있습니다. 특히 http://www.mosync.com/docs/sdk/cpp/guides/libs/working-with-mosync-libraries/index.html

:

As well as referencing the header files in your application code, you also need to specify the actual libraries that you want to use in the project's Build Settings (Project > Properties > MoSync Project > Build Settings):

그것은 화면 코드를 포함해야 maui.lib과 같은

은이 페이지를 참조하십시오.

+0

예, maui.lib에이 코드가 포함되어 있습니다. 감사! –

관련 문제