Cocos2d-x CocoStudio libGUI 등 프로젝트 종속성 추가 이슈

 Cocos2d-x 3.0 alpha1 에 Coco Studio용 GUI를 사용하기 위해 아래 그림과 같이 원래 하던데로 프로젝트 종속성(Project Dependencies) 메뉴에 libGUI를 추가해주고 빌드를 해봤지만,


Error 5 error LNK2019: unresolved external symbol "public: __thiscall gui::UIMargin::UIMargin(void)" (??0UIMargin@gui@@QAE@XZ) referenced in function "void __cdecl gui::`dynamic initializer for 'UIMarginZero''(void)" (??__EUIMarginZero@gui@@YAXXZ) D:\cocos2d-x-3.0alpha1\projects\testgame\proj.win32\AppDelegate.obj testgame
Error 6 error LNK2001: unresolved external symbol "public: __thiscall gui::UIMargin::UIMargin(void)" (??0UIMargin@gui@@QAE@XZ) D:\cocos2d-x-3.0alpha1\projects\testgame\proj.win32\HelloWorldScene.obj testgame
Error 7 error LNK2019: unresolved external symbol "public: void __thiscall gui::UIWidget::setPosition(class cocos2d::Point const &)" (?setPosition@UIWidget@gui@@QAEXABVPoint@cocos2d@@@Z) referenced in function "public: virtual bool __thiscall HelloWorld::init(void)" (?init@HelloWorld@@UAE_NXZ) D:\cocos2d-x-3.0alpha1\projects\testgame\proj.win32\HelloWorldScene.obj testgame
Error 8 error LNK2019: unresolved external symbol "public: static class gui::UILabel * __cdecl gui::UILabel::create(void)" (?create@UILabel@gui@@SAPAV12@XZ) referenced in function "public: virtual bool __thiscall HelloWorld::init(void)" (?init@HelloWorld@@UAE_NXZ) D:\cocos2d-x-3.0alpha1\projects\testgame\proj.win32\HelloWorldScene.obj testgame
Error 9 error LNK2019: unresolved external symbol "public: void __thiscall gui::UILabel::setText(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?setText@UILabel@gui@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: virtual bool __thiscall HelloWorld::init(void)" (?init@HelloWorld@@UAE_NXZ) D:\cocos2d-x-3.0alpha1\projects\testgame\proj.win32\HelloWorldScene.obj testgame
Error 10 error LNK2019: unresolved external symbol "public: void __thiscall gui::UILabel::setFontSize(int)" (?setFontSize@UILabel@gui@@QAEXH@Z) referenced in function "public: virtual bool __thiscall HelloWorld::init(void)" (?init@HelloWorld@@UAE_NXZ) D:\cocos2d-x-3.0alpha1\projects\testgame\proj.win32\HelloWorldScene.obj testgame
Error 11 error LNK2019: unresolved external symbol "public: void __thiscall gui::UILabel::setFontName(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?setFontName@UILabel@gui@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: virtual bool __thiscall HelloWorld::init(void)" (?init@HelloWorld@@UAE_NXZ) D:\cocos2d-x-3.0alpha1\projects\testgame\proj.win32\HelloWorldScene.obj testgame
Error 12 error LNK1120: 6 unresolved externals D:\cocos2d-x-3.0alpha1\projects\testgame\proj.win32\Debug.win32\testgame.exe 1 1 testgame

 위와 같은 에러를 뿜더군요. 이상하다 싶어 TestCpp 프로젝트의 속성을 확인해봐도 Linker - Input에 추가 종속성도 안 걸려있더군요. 소스딴 pragma once 로 추가된 것도 아니었구요. 샘플은 되는데 project creator로 생성한 건 왜 안될까 싶었는데

 프로젝트 속성 - Common Properties - Framework and References에 위와 같이 종속성 추가할 참조 추가를 할 수 있는 메뉴가 있네요. Add New Reference를 눌러 libGUI 를 추가해준후 빌드합니다.

Error 5 error LNK2019: unresolved external symbol "public: static class cocos2d::extension::Scale9Sprite * __cdecl cocos2d::extension::Scale9Sprite::create(void)" (?create@Scale9Sprite@extension@cocos2d@@SAPAV123@XZ) referenced in function "protected: void __thiscall gui::UILayout::addBackGroundImage(void)" (?addBackGroundImage@UILayout@gui@@IAEXXZ) D:\cocos2d-x-3.0alpha1\projects\testgame\proj.win32\libGUI.lib(UILayout.obj) testgame
Error 6 error LNK1120: 1 unresolved externals D:\cocos2d-x-3.0alpha1\projects\testgame\proj.win32\Debug.win32\testgame.exe 1 1 testgame

 그러면 위와 같은 에러가 나는데 libGUI 내부적으로 libExtension을 사용해서 발생한 에러입니다.

 libExtensions도 참조로 추가해주면 빌드가 잘 됩니다.

 프로젝트 속성에 들어가기전 References 메뉴를 통해서도 참조 작업을 바로 수행할 수 있습니다.

 이런 참조 작업을 진행하면 자동으로 프로젝트 종속성 메뉴에 종속성이 추가가 되더군요. 체크 해제도 위와같이 안되구요.

 Cocos2d-x 를 떠나서 비주얼 스튜디오는 2010 이상 C++ 프로젝트면 이런 이슈가 있을 듯 합니다.  비주얼 스튜디오가 버전업 되면 프로젝트 종속성 메뉴는 사라지지 않을까 생각해봅니다.

댓글

이 블로그의 인기 게시물

'xxx.exe' 프로그램을 시작할 수 없습니다. 지정된 파일을 찾을 수 없습니다.

goorm IDE에서 node.js 프로젝트로 Hello World Simple Server 만들어 띄워보기

애드센스 수익을 웨스턴 유니온으로 수표대신 현금으로 지급 받아보자.