[SOLVED]MyGUI 3.20 Unable to Compile, Linker Errors

Xethik

18-09-2013 21:36:48

Hey all, I'm having some trouble getting MyGUI to compile on my Windows 7 64-bit machine with Visual Studios 2010.
I'm running MyGUI 3.20 from SourceForge and I'm running into some... bizarre linker errors. They definitely seem tied to FreeType, but I have the libs linked, so I'm not sure where the problem is.

Here is a clip of the error messages:
error LNK1120: 13 unresolved externals D:\Program Files (x86)\MyGUI_3.2.0\build\cmake\bin\Release\MyGUIEngine.dll MyGUIEngine
error LNK2019: unresolved external symbol __imp_FT_Bitmap_Convert referenced in function "private: void __cdecl MyGUI::ResourceTrueTypeFont::renderGlyphs<0,0>... lengthy and most unhelpful linker error stuff follows


the full, lengthy, and unreadable version is here:
Error 29 error LNK1120: 13 unresolved externals D:\Program Files (x86)\MyGUI_3.2.0\build\cmake\bin\Debug\MyGUIEngine_d.dll MyGUIEngine
Error 27 error LNK2019: unresolved external symbol __imp_FT_Bitmap_Convert referenced in function "private: void __cdecl MyGUI::ResourceTrueTypeFont::renderGlyphs<0,0>(class std::map<long,class std::map<unsigned int,struct MyGUI::GlyphInfo *,struct std::less<unsigned int>,class std::allocator<struct std::pair<unsigned int const ,struct MyGUI::GlyphInfo *> > >,struct std::less<long>,class std::allocator<struct std::pair<long const ,class std::map<unsigned int,struct MyGUI::GlyphInfo *,struct std::less<unsigned int>,class std::allocator<struct std::pair<unsigned int const ,struct MyGUI::GlyphInfo *> > > > > > const &,struct FT_LibraryRec_ * const &,struct FT_FaceRec_ * const &,unsigned char *,int,int)" (??$renderGlyphs@$0A@$0A@@ResourceTrueTypeFont@MyGUI@@AEAAXAEBV?$map@JV?$map@IPEAUGlyphInfo@MyGUI@@U?$less@I@std@@V?$allocator@U?$pair@$$CBIPEAUGlyphInfo@MyGUI@@@std@@@4@@std@@U?$less@J@2@V?$allocator@U?$pair@$$CBJV?$map@IPEAUGlyphInfo@MyGUI@@U?$less@I@std@@V?$allocator@U?$pair@$$CBIPEAUGlyphInfo@MyGUI@@@std@@@4@@std@@@std@@@2@@std@@AEBQEAUFT_LibraryRec_@@AEBQEAUFT_FaceRec_@@PEAEHH@Z) D:\Program Files (x86)\MyGUI_3.2.0\build\cmake\MyGUIEngine\MyGUI_ResourceTrueTypeFont.obj MyGUIEngine
Error 26 error LNK2019: unresolved external symbol __imp_FT_Bitmap_Done referenced in function "private: void __cdecl MyGUI::ResourceTrueTypeFont::renderGlyphs<0,0>(class std::map<long,class std::map<unsigned int,struct MyGUI::GlyphInfo *,struct std::less<unsigned int>,class std::allocator<struct std::pair<unsigned int const ,struct MyGUI::GlyphInfo *> > >,struct std::less<long>,class std::allocator<struct std::pair<long const ,class std::map<unsigned int,struct MyGUI::GlyphInfo *,struct std::less<unsigned int>,class std::allocator<struct std::pair<unsigned int const ,struct MyGUI::GlyphInfo *> > > > > > const &,struct FT_LibraryRec_ * const &,struct FT_FaceRec_ * const &,unsigned char *,int,int)" (??$renderGlyphs@$0A@$0A@@ResourceTrueTypeFont@MyGUI@@AEAAXAEBV?$map@JV?$map@IPEAUGlyphInfo@MyGUI@@U?$less@I@std@@V?$allocator@U?$pair@$$CBIPEAUGlyphInfo@MyGUI@@@std@@@4@@std@@U?$less@J@2@V?$allocator@U?$pair@$$CBJV?$map@IPEAUGlyphInfo@MyGUI@@U?$less@I@std@@V?$allocator@U?$pair@$$CBIPEAUGlyphInfo@MyGUI@@@std@@@4@@std@@@std@@@2@@std@@AEBQEAUFT_LibraryRec_@@AEBQEAUFT_FaceRec_@@PEAEHH@Z) D:\Program Files (x86)\MyGUI_3.2.0\build\cmake\MyGUIEngine\MyGUI_ResourceTrueTypeFont.obj MyGUIEngine
Error 28 error LNK2019: unresolved external symbol __imp_FT_Bitmap_New referenced in function "private: void __cdecl MyGUI::ResourceTrueTypeFont::renderGlyphs<0,0>(class std::map<long,class std::map<unsigned int,struct MyGUI::GlyphInfo *,struct std::less<unsigned int>,class std::allocator<struct std::pair<unsigned int const ,struct MyGUI::GlyphInfo *> > >,struct std::less<long>,class std::allocator<struct std::pair<long const ,class std::map<unsigned int,struct MyGUI::GlyphInfo *,struct std::less<unsigned int>,class std::allocator<struct std::pair<unsigned int const ,struct MyGUI::GlyphInfo *> > > > > > const &,struct FT_LibraryRec_ * const &,struct FT_FaceRec_ * const &,unsigned char *,int,int)" (??$renderGlyphs@$0A@$0A@@ResourceTrueTypeFont@MyGUI@@AEAAXAEBV?$map@JV?$map@IPEAUGlyphInfo@MyGUI@@U?$less@I@std@@V?$allocator@U?$pair@$$CBIPEAUGlyphInfo@MyGUI@@@std@@@4@@std@@U?$less@J@2@V?$allocator@U?$pair@$$CBJV?$map@IPEAUGlyphInfo@MyGUI@@U?$less@I@std@@V?$allocator@U?$pair@$$CBIPEAUGlyphInfo@MyGUI@@@std@@@4@@std@@@std@@@2@@std@@AEBQEAUFT_LibraryRec_@@AEBQEAUFT_FaceRec_@@PEAEHH@Z) D:\Program Files (x86)\MyGUI_3.2.0\build\cmake\MyGUIEngine\MyGUI_ResourceTrueTypeFont.obj MyGUIEngine
Error 17 error LNK2019: unresolved external symbol __imp_FT_Done_Face referenced in function "private: struct FT_FaceRec_ * __cdecl MyGUI::ResourceTrueTypeFont::loadFace(struct FT_LibraryRec_ * const &,unsigned char * &)" (?loadFace@ResourceTrueTypeFont@MyGUI@@AEAAPEAUFT_FaceRec_@@AEBQEAUFT_LibraryRec_@@AEAPEAE@Z) D:\Program Files (x86)\MyGUI_3.2.0\build\cmake\MyGUIEngine\MyGUI_ResourceTrueTypeFont.obj MyGUIEngine
Error 22 error LNK2019: unresolved external symbol __imp_FT_Done_FreeType referenced in function "private: void __cdecl MyGUI::ResourceTrueTypeFont::initialiseFreeType<0,0>(void)" (??$initialiseFreeType@$0A@$0A@@ResourceTrueTypeFont@MyGUI@@AEAAXXZ) D:\Program Files (x86)\MyGUI_3.2.0\build\cmake\MyGUIEngine\MyGUI_ResourceTrueTypeFont.obj MyGUIEngine
Error 23 error LNK2019: unresolved external symbol __imp_FT_Get_Char_Index referenced in function "private: void __cdecl MyGUI::ResourceTrueTypeFont::initialiseFreeType<0,0>(void)" (??$initialiseFreeType@$0A@$0A@@ResourceTrueTypeFont@MyGUI@@AEAAXXZ) D:\Program Files (x86)\MyGUI_3.2.0\build\cmake\MyGUIEngine\MyGUI_ResourceTrueTypeFont.obj MyGUIEngine
Error 24 error LNK2019: unresolved external symbol __imp_FT_Get_Sfnt_Table referenced in function "private: void __cdecl MyGUI::ResourceTrueTypeFont::initialiseFreeType<0,0>(void)" (??$initialiseFreeType@$0A@$0A@@ResourceTrueTypeFont@MyGUI@@AEAAXXZ) D:\Program Files (x86)\MyGUI_3.2.0\build\cmake\MyGUIEngine\MyGUI_ResourceTrueTypeFont.obj MyGUIEngine
Error 18 error LNK2019: unresolved external symbol __imp_FT_Get_WinFNT_Header referenced in function "private: struct FT_FaceRec_ * __cdecl MyGUI::ResourceTrueTypeFont::loadFace(struct FT_LibraryRec_ * const &,unsigned char * &)" (?loadFace@ResourceTrueTypeFont@MyGUI@@AEAAPEAUFT_FaceRec_@@AEBQEAUFT_LibraryRec_@@AEAPEAE@Z) D:\Program Files (x86)\MyGUI_3.2.0\build\cmake\MyGUIEngine\MyGUI_ResourceTrueTypeFont.obj MyGUIEngine
Error 25 error LNK2019: unresolved external symbol __imp_FT_Init_FreeType referenced in function "private: void __cdecl MyGUI::ResourceTrueTypeFont::initialiseFreeType<0,0>(void)" (??$initialiseFreeType@$0A@$0A@@ResourceTrueTypeFont@MyGUI@@AEAAXXZ) D:\Program Files (x86)\MyGUI_3.2.0\build\cmake\MyGUIEngine\MyGUI_ResourceTrueTypeFont.obj MyGUIEngine
Error 21 error LNK2019: unresolved external symbol __imp_FT_Load_Glyph referenced in function "private: int __cdecl MyGUI::ResourceTrueTypeFont::createFaceGlyph(unsigned int,unsigned int,int,struct FT_FaceRec_ * const &,class std::map<long,class std::map<unsigned int,struct MyGUI::GlyphInfo *,struct std::less<unsigned int>,class std::allocator<struct std::pair<unsigned intconst ,struct MyGUI::GlyphInfo *> > >,struct std::less<long>,class std::allocator<struct std::pair<long const ,class std::map<unsigned int,struct MyGUI::GlyphInfo *,struct std::less<unsigned int>,class std::allocator<struct std::pair<unsigned int const ,struct MyGUI::GlyphInfo *> > > > > > &)" (?createFaceGlyph@ResourceTrueTypeFont@MyGUI@@AEAAHIIHAEBQEAUFT_FaceRec_@@AEAV?$map@JV?$map@IPEAUGlyphInfo@MyGUI@@U?$less@I@std@@V?$allocator@U?$pair@$$CBIPEAUGlyphInfo@MyGUI@@@std@@@4@@std@@U?$less@J@2@V?$allocator@U?$pair@$$CBJV?$map@IPEAUGlyphInfo@MyGUI@@U?$less@I@std@@V?$allocator@U?$pair@$$CBIPEAUGlyphInfo@MyGUI@@@std@@@4@@std@@@std@@@2@@std@@@Z) D:\Program Files (x86)\MyGUI_3.2.0\build\cmake\MyGUIEngine\MyGUI_ResourceTrueTypeFont.obj MyGUIEngine
Error 20 error LNK2019: unresolved external symbol __imp_FT_New_Memory_Face referenced in function "private: struct FT_FaceRec_ * __cdecl MyGUI::ResourceTrueTypeFont::loadFace(struct FT_LibraryRec_ * const &,unsigned char * &)" (?loadFace@ResourceTrueTypeFont@MyGUI@@AEAAPEAUFT_FaceRec_@@AEBQEAUFT_LibraryRec_@@AEAPEAE@Z) D:\Program Files (x86)\MyGUI_3.2.0\build\cmake\MyGUIEngine\MyGUI_ResourceTrueTypeFont.obj MyGUIEngine
Error 16 error LNK2019: unresolved external symbol __imp_FT_Select_Size referenced in function "private: struct FT_FaceRec_ * __cdecl MyGUI::ResourceTrueTypeFont::loadFace(struct FT_LibraryRec_ * const &,unsigned char * &)" (?loadFace@ResourceTrueTypeFont@MyGUI@@AEAAPEAUFT_FaceRec_@@AEBQEAUFT_LibraryRec_@@AEAPEAE@Z) D:\Program Files (x86)\MyGUI_3.2.0\build\cmake\MyGUIEngine\MyGUI_ResourceTrueTypeFont.obj MyGUIEngine
Error 19 error LNK2019: unresolved external symbol __imp_FT_Set_Char_Size referenced in function "private: struct FT_FaceRec_ * __cdecl MyGUI::ResourceTrueTypeFont::loadFace(struct FT_LibraryRec_ * const &,unsigned char * &)" (?loadFace@ResourceTrueTypeFont@MyGUI@@AEAAPEAUFT_FaceRec_@@AEBQEAUFT_LibraryRec_@@AEAPEAE@Z) D:\Program Files (x86)\MyGUI_3.2.0\build\cmake\MyGUIEngine\MyGUI_ResourceTrueTypeFont.obj MyGUIEngine


So... it definitely appears linked to FreeType due to all the "FT"s. Also, if I delete my FreeType libs from additional dependencies, the error doesn't change. And the __imp_ are kind of weirding me out. As far as I know, that usually means something with DLLs, but I'm using static libs here. Am I supposed to have a DLL, too?

Thanks for the help, lemme know what other info you need.

Altren

18-09-2013 23:52:57

If you are sure, that proper freetype library is in additional dependencies to MyGUIEngine then I'd recommend to try next things:
- install Visual Studio 2010sp1 if you haven't done this yet;
- rebuild freetype and reconfigure cmake from scratch (this is important, since it can pick one of release or debug libs for both release and debug);
- clean/rebuild/clean/rebuild...

Xethik

19-09-2013 01:49:14

Okay, I'll do this. Just to be sure, could you give me a hand in linking the proper Freetype I should be downloading (and then rebuilding?) I want to be sure I'm not making a mistake there.

EDIT: To clarify, I just retried this on a fresh install of Windows 8 (64-bit) with a fresh install of Visual Studio 2010 Service Package 1 and the error replicated itself, so I'm nearly certain I'm just making a major mistake along the way.

Xethik

19-09-2013 03:13:25

So here is a rough outline of what I just tried. I'm getting the same error.

Downloaded the ft2501.zip from http://sourceforge.net/projects/freetyp ... pe2/2.5.0/
Extracted it
Went to freetype-2.5.0.1\builds\win32\vc2010
Ran freetype.sln
Built the solution in both Debug and Release
Went to freetype-2.5.0.1\objs\win32\vc2010 and copied freetype250.lib to freetype-2.5.0.1\objs\release
Did the same for freetype250_d.lib into freetype-2.5.0.1\objs\debug

Set environment variable FREETYPE_DIR and MYGUI_DEPENDENCIES_DIR to freetype-2.5.0.1
Ran CMake, configured to Visual Studio 10 Win64 to a new directory, CMake said it could not find MYGUI_DEPENDENCIES_DIR. Manually set BOOST_DIR, OGRE_SOURCE, FREETYPE_LIBRARY_DBG and FREETYPE_LIBRARY_REL
FREETYPE_LIBRARY_DBG was set directly to the freetype250.lib file in objs\release
FREETYPE_LIBRARY_REL was set directly to the freetype250_d.lib file in objs\debug

Hit configure again, worked. Generate.
Ran the MyGUI.sln in Visual Studios 2010 SP1, attempted to build and same error repeated. Checked Additional Library Dependencies, files were correctly listed under both debug and release.

Anyone see where I goofed? I tried a bunch of other random things, too, but this seemed to be what I most expected to work. For example, I moved the libs to freetype-2.5.0.1\lib\debug and \release, but all that did was fill in FREETYPE_LIBRARY_DBG and REL for me. After generating from scratch, the same error occurred.

EDIT: Here is a screenshot showing my debug dependencies and the folder related to it. Am I missing something obvious? http://i.imgur.com/z0N4eSV.png

Xethik

19-09-2013 06:13:58

Hate to be the guy who triple posts, but I want to make a noticeable update.

I fixed the issue, I'm just an idiot. I didn't realize I needed to check off MYGUI_STATIC for it to work properly. I'm not sure if this is something I just missed in the instructions or if I was following something that forgot to mention it. Either way, it explains why I was so confused about the __imp_, it WAS looking for DLLs. If I have any issues in the future, I'll come back, but I'm marking this as solved for now.

Xethik

19-09-2013 22:53:32

Okay, marking this as unsolved. Turns out, when trying to import the freetype.libs into my file using the MyGUI, it's also having unresolved external issues (the same, minus the __imp_ portions). So, I guess it all boils down to the same issue. For some reason, my Freetype libs are not linking correctly to anything. I'd appreciate it if anyone could give me a hand/hint here, hopefully my steps above show where I went wrong.

EDIT: Remarking solved. I was able to compile the freetype libs as x64 bit. I hadn't realized I could just hit new under machine type and select x64, lack of knowledge on my part.

Altren

20-09-2013 20:08:13

Could you summarize important part of your investigations? I'm not sure what is your conclusion.
Is it that MYGUI_STATIC doesn't work properly and cause linker errors during MyGUI build
or that you build MyGUI as static lib, but forgot to add freetype to you own application
or something else?