CEGUI VS2003에서 컴파일 및 링크하기

 CEGUI 0.7.9를 빌드중 에러가 발생하네요. 참고로 비쥬얼 스튜디오 2003에서 작업중에 있습니다.


1. 각종 fatal error C1083: 포함 파일을 열 수 없습니다. 에러




Cegui-0.7.9\cegui\include\CEGUIPCRERegexMatcher.h(33): fatal error C1083: 포함 파일을 열 수 없습니다. 'pcre.h': No such file or directory

CEGUI-0.7.9\cegui\src\minizip\unzip.h(51): fatal error C1083: 포함 파일을 열 수 없습니다. 'zlib.h': No such file or directory

Cegui-0.7.9\cegui\include\CEGUIFreeTypeFont.h(37): fatal error C1083: 포함 파일을 열 수 없습니다. 'ft2build.h': No such file or directory

Cegui-0.7.9\cegui\include\ScriptingModules\LuaScriptModule\support\tolua++\tolua++.h(68): fatal error C1083: 포함 파일을 열 수 없습니다. 'lua.h': No such file or directory

CEGUI-0.7.9\cegui\src\XMLParserModules\ExpatParser\CEGUIExpatParser.cpp(35): fatal error C1083: 포함 파일을 열 수 없습니다. 'expat.h': No such file or directory

CEGUI-0.7.9\cegui\src\ImageCodecModules\SILLYImageCodec\CEGUISILLYImageCodec.cpp(32): fatal error C1083: 포함 파일을 열 수 없습니다. 'SILLY.h': No such file or directory

CEGUI-0.7.9\cegui\src\ImageCodecModules\DevILImageCodec\CEGUIDevILImageCodec.cpp(32): fatal error C1083: 포함 파일을 열 수 없습니다. 'IL/il.h': No such file or directory

CEGUI-0.7.9\cegui\src\ImageCodecModules\CoronaImageCodec\CEGUICoronaImageCodec.cpp(34): fatal error C1083: 포함 파일을 열 수 없습니다. 'corona.h': No such file or directory

CEGUI-0.7.9\cegui\src\ImageCodecModules\FreeImageImageCodec\CEGUIFreeImageImageCodec.cpp(35): fatal error C1083: 포함 파일을 열 수 없습니다. 'FreeImage.h': No such file or directory

 이와 같이 각종 포함 파일을 열 수 없는 에러가 발생 시 CEGUI가 필요로 하는 의존성 모듈을 설치해줘야합니다.


 CEGUIBase 프로젝트 속성에서 추가 포함 디렉터리를 보니 dependencies 디렉터리에 설치해주면 되네요.

 CEGUI 0.7.9 다운로드 페이지를 가보니 MSVC++ 2005가 제일 낮은거네요. 2003이 안보여서 일단 MSVC++ 2005용으로 다운 받았습니다.

 CEGUI 루트 디렉터리에 압축해제 했습니다. 이제 빌드하면 많은 에러가 해결 됩니다.


2. CEGUIBase 컴파일 에러

CEGUI-0.7.9\cegui\src\CEGUIDefaultResourceProvider.cpp(219): error C2664: '_wfindfirst' : 매개 변수 1을(를) 'const wchar_t *'에서 'wchar_t *'(으)로 변환할 수 없습니다.
        변환하면서 한정자가 손실됩니다.


if ((f = _wfindfirst(Utf8ToUtf16((dir_name + file_pattern).c_str()).c_str(), &fd)) != -1)

 이것을 아래와 같이 수정합니다.

if ((f = _wfindfirst(const_cast<wchar_t*>(Utf8ToUtf16((dir_name + file_pattern).c_str()).c_str()), &fd)) != -1)


 여기까지 했다면 이제 CEGUIBase가 빌드되기 때문에  CEGUISTBImageCodec fatal error LNK1104: '../../../../lib/CEGUIBase_d.lib' 파일을 열 수 없습니다. 에러는 발생하지 않을 것입니다.


3. 각종 링크 에러들


CEGUIExpatParser error LNK2019: __imp___wassert 외부 기호(_XML_GetParsingStatus 함수에서 참조)를 확인하지 못했습니다.

CEGUICoronaImageCodec error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::operator+<char,struct std::char_traits<char>,class std::allocator<char> >(char const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBDABV10@@Z)이(가) CEGUICoronaImageCodec.obj에 이미 정의되어 있습니다.

CEGUICoronaImageCodec error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::operator+<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,char const *)" (??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@PBD@Z)이(가) CEGUICoronaImageCodec.obj에 이미 정의되어 있습니다.

CEGUICoronaImageCodec error LNK2019: "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(struct std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Has_debug_it)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@U_Has_debug_it@01@@Z) 외부 기호("public: __thiscall corona::hidden::FFDImpl::FFDImpl(enum corona::FileFormat,char const *,char const *)" (??0FFDImpl@hidden@corona@@QAE@W4FileFormat@2@PBD1@Z) 함수에서 참조)를 확인하지 못했습니다.



CEGUICoronaImageCodec error LNK2001: ___CxxFrameHandler3 외부 기호를 확인할 수 없습니다.

CEGUICoronaImageCodec error LNK2019: ___CxxFrameHandler3 외부 기호(__ehhandler$??0FFDImpl@hidden@corona@@QAE@W4FileFormat@2@PBD1@Z 함수에서 참조)를 확인하지 못했습니다.

CEGUICoronaImageCodec error LNK2019: __imp___invalid_parameter 외부 기호("public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >::operator[](unsigned int)" (??A?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAEAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@I@Z) 함수에서 참조)를 확인하지 못했습니다.

CEGUICoronaImageCodec error LNK2019: __imp___CrtDbgReportW 외부 기호("public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >::operator[](unsigned int)" (??A?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAEAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@I@Z) 함수에서 참조)를 확인하지 못했습니다.

CEGUICoronaImageCodec error LNK2019: "__declspec(dllimport) void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (__imp_?_Debug_message@std@@YAXPB_W0I@Z) 외부 기호("public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >::operator[](unsigned int)" (??A?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAEAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@I@Z) 함수에서 참조)를 확인하지 못했습니다.



CEGUICoronaImageCodec error LNK2001: "public: __thiscall std::exception::exception(class std::exception const &)" (??0exception@std@@QAE@ABV01@@Z) 외부 기호를 확인할 수 없습니다.

CEGUICoronaImageCodec error LNK2019: __ftol2_sse 외부 기호(_png_set_cHRM 함수에서 참조)를 확인하지 못했습니다.

 무서운? 링크에러가 남발하네요. 아무래도 의존성 모듈이 버전이 달라서 그런 듯 해보입니다. 그래서 구글링을 해보니 공식 사이트에는 없던 2003용 의존성 모듈도움말 사이트에 있네요. 링크를 클릭해서 다운받아 아까와 같이 압축 해제합니다.


4. DX 관련 에러

CEGUI-0.7.9\cegui\include\RendererModules\Direct3D9\CEGUIDirect3D9Renderer.h(36): fatal error C1083: 포함 파일을 열 수 없습니다. 'd3d9.h': No such file or directory
CEGUI-0.7.9\cegui\src\RendererModules\Direct3D9\CEGUIDirect3D9Texture.cpp(29): fatal error C1083: 포함 파일을 열 수 없습니다. 'd3dx9.h': No such file or directory

 CEGUIDirect3D9Renderer 프로젝트 속성에서 추가 포함디렉터리에 각자 개발 환경에 맞는 dx sdk의 include 디렉터리를 추가합니다. 저는 스샷과 같이 추가했습니다.

 쎈스있게 추가 라이브러리 디렉터리도 추가해줬습니다. 그런데,

LINK : fatal error LNK1104: 'dxerr.lib' 파일을 열 수 없습니다.

 에러가 발생하네요.

 DX 버전이 2005년 버전이라 낮아서 그런지 파일명이 다르네요.

 실제 파일은 svn에 올라가있으니 수정하기 그래서 프로젝트 속성에서 추가 종속성에 dxerr.lib를 DxErr9.lib로 수정해줬습니다.

 드디어 CEGUI 0.7.9를 VS2003에서 빌드 성공했습니다.

댓글

이 블로그의 인기 게시물

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

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

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