Static linking

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Hideo
Just popping in
Just popping in
Posts: 10
Joined: Thu Jan 07, 2010 02:48

Static linking

Postby Hideo » Thu Jan 07, 2010 12:56

Is it possible to link everything static? I mean I have only CEGUI.dll in solution dir and nothing else.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Static linking

Postby CrazyEddie » Thu Jan 07, 2010 13:51

Hi,

It's possible to statically link everything to your application executable - so you just have the executable and no DLL files at all. I don't think it's possible to bundle the entire CEGUI content into a single DLL, though.

HTH

CE.

Hideo
Just popping in
Just popping in
Posts: 10
Joined: Thu Jan 07, 2010 02:48

Re: Static linking

Postby Hideo » Thu Jan 07, 2010 14:03

I tried to use "_static" versions of provided libraries but I get ton of nasty linker errors:

MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
WindowManager.obj : warning LNK4217: locally defined symbol ?renderGUI@System@CEGUI@@QAEXXZ (public: void __thiscall CEGUI::System::renderGUI(void)) imported in function "void __cdecl DrawWindows(void)" (?DrawWindows@@YAXXZ)
WindowManager.obj : warning LNK4217: locally defined symbol ?getSingleton@System@CEGUI@@SAAAV12@XZ (public: static class CEGUI::System & __cdecl CEGUI::System::getSingleton(void)) imported in function "void __cdecl DrawWindows(void)" (?DrawWindows@@YAXXZ)
WindowManager.obj : warning LNK4217: locally defined symbol ??1String@CEGUI@@QAE@XZ (public: __thiscall CEGUI::String::~String(void)) imported in function "public: virtual enum Result_t __thiscall WindowManagerModule_t::Startup(void)" (?Startup@WindowManagerModule_t@@UAE?AW4Result_t@@XZ)
WindowManager.obj : warning LNK4217: locally defined symbol ?create@System@CEGUI@@SAAAV12@AAVRenderer@2@PAVResourceProvider@2@PAVXMLParser@2@PAVImageCodec@2@PAVScriptModule@2@ABVString@2@5@Z (public: static class CEGUI::System & __cdecl CEGUI::System::create(class CEGUI::Renderer &,class CEGUI::ResourceProvider *,class CEGUI::XMLParser *,class CEGUI::ImageCodec *,class CEGUI::ScriptModule *,class CEGUI::String const &,class CEGUI::String const &)) imported in function "public: virtual enum Result_t __thiscall WindowManagerModule_t::Startup(void)" (?Startup@WindowManagerModule_t@@UAE?AW4Result_t@@XZ)
WindowManager.obj : warning LNK4217: locally defined symbol ??0String@CEGUI@@QAE@PBD@Z (public: __thiscall CEGUI::String::String(char const *)) imported in function "public: virtual enum Result_t __thiscall WindowManagerModule_t::Startup(void)" (?Startup@WindowManagerModule_t@@UAE?AW4Result_t@@XZ)
WindowManager.obj : warning LNK4217: locally defined symbol ??0FreeImageImageCodec@CEGUI@@QAE@XZ (public: __thiscall CEGUI::FreeImageImageCodec::FreeImageImageCodec(void)) imported in function "public: virtual enum Result_t __thiscall WindowManagerModule_t::Startup(void)" (?Startup@WindowManagerModule_t@@UAE?AW4Result_t@@XZ)
WindowManager.obj : warning LNK4217: locally defined symbol ??1FreeImageImageCodec@CEGUI@@UAE@XZ (public: virtual __thiscall CEGUI::FreeImageImageCodec::~FreeImageImageCodec(void)) imported in function "public: virtual void * __thiscall CEGUI::FreeImageImageCodec::`scalar deleting destructor'(unsigned int)" (??_GFreeImageImageCodec@CEGUI@@UAEPAXI@Z)
WindowManager.obj : warning LNK4217: locally defined symbol ?destroy@System@CEGUI@@SAXXZ (public: static void __cdecl CEGUI::System::destroy(void)) imported in function "public: virtual enum Result_t __thiscall WindowManagerModule_t::Shutdown(void)" (?Shutdown@WindowManagerModule_t@@UAE?AW4Result_t@@XZ)
WindowManager.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class CEGUI::Direct3D9Renderer & __cdecl CEGUI::Direct3D9Renderer::create(struct IDirect3DDevice9 *)" (__imp_?create@Direct3D9Renderer@CEGUI@@SAAAV12@PAUIDirect3DDevice9@@@Z) referenced in function "public: virtual enum Result_t __thiscall WindowManagerModule_t::Startup(void)" (?Startup@WindowManagerModule_t@@UAE?AW4Result_t@@XZ)
CEGUIFreeImageImageCodec_static.lib(CEGUIFreeImageImageCodec.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_DeInitialise@0 referenced in function "public: virtual __thiscall CEGUI::FreeImageImageCodec::~FreeImageImageCodec(void)" (??1FreeImageImageCodec@CEGUI@@UAE@XZ)
CEGUIFreeImageImageCodec_static.lib(CEGUIFreeImageImageCodec.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_GetFormatFromFIF@4 referenced in function "void __cdecl `anonymous namespace'::FreeImageErrorHandler(enum FREE_IMAGE_FORMAT,char const *)" (?FreeImageErrorHandler@?A0x02b1de8b@@YAXW4FREE_IMAGE_FORMAT@@PBD@Z)
CEGUIFreeImageImageCodec_static.lib(CEGUIFreeImageImageCodec.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_GetFIFExtensionList@4 referenced in function "public: __thiscall CEGUI::FreeImageImageCodec::FreeImageImageCodec(void)" (??0FreeImageImageCodec@CEGUI@@QAE@XZ)
CEGUIFreeImageImageCodec_static.lib(CEGUIFreeImageImageCodec.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_GetFIFCount@0 referenced in function "public: __thiscall CEGUI::FreeImageImageCodec::FreeImageImageCodec(void)" (??0FreeImageImageCodec@CEGUI@@QAE@XZ)
CEGUIFreeImageImageCodec_static.lib(CEGUIFreeImageImageCodec.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_SetOutputMessage@4 referenced in function "public: __thiscall CEGUI::FreeImageImageCodec::FreeImageImageCodec(void)" (??0FreeImageImageCodec@CEGUI@@QAE@XZ)
CEGUIFreeImageImageCodec_static.lib(CEGUIFreeImageImageCodec.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_Initialise@4 referenced in function "public: __thiscall CEGUI::FreeImageImageCodec::FreeImageImageCodec(void)" (??0FreeImageImageCodec@CEGUI@@QAE@XZ)
CEGUIFreeImageImageCodec_static.lib(CEGUIFreeImageImageCodec.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_CloseMemory@4 referenced in function __catch$?load@FreeImageImageCodec@CEGUI@@UAEPAVTexture@2@ABVRawDataContainer@2@PAV32@@Z$0
CEGUIFreeImageImageCodec_static.lib(CEGUIFreeImageImageCodec.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_ConvertToRawBits@32 referenced in function "public: virtual class CEGUI::Texture * __thiscall CEGUI::FreeImageImageCodec::load(class CEGUI::RawDataContainer const &,class CEGUI::Texture *)" (?load@FreeImageImageCodec@CEGUI@@UAEPAVTexture@2@ABVRawDataContainer@2@PAV32@@Z)
CEGUIFreeImageImageCodec_static.lib(CEGUIFreeImageImageCodec.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_GetWidth@4 referenced in function "public: virtual class CEGUI::Texture * __thiscall CEGUI::FreeImageImageCodec::load(class CEGUI::RawDataContainer const &,class CEGUI::Texture *)" (?load@FreeImageImageCodec@CEGUI@@UAEPAVTexture@2@ABVRawDataContainer@2@PAV32@@Z)
CEGUIFreeImageImageCodec_static.lib(CEGUIFreeImageImageCodec.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_GetHeight@4 referenced in function "public: virtual class CEGUI::Texture * __thiscall CEGUI::FreeImageImageCodec::load(class CEGUI::RawDataContainer const &,class CEGUI::Texture *)" (?load@FreeImageImageCodec@CEGUI@@UAEPAVTexture@2@ABVRawDataContainer@2@PAV32@@Z)
CEGUIFreeImageImageCodec_static.lib(CEGUIFreeImageImageCodec.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_GetPitch@4 referenced in function "public: virtual class CEGUI::Texture * __thiscall CEGUI::FreeImageImageCodec::load(class CEGUI::RawDataContainer const &,class CEGUI::Texture *)" (?load@FreeImageImageCodec@CEGUI@@UAEPAVTexture@2@ABVRawDataContainer@2@PAV32@@Z)
CEGUIFreeImageImageCodec_static.lib(CEGUIFreeImageImageCodec.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_Unload@4 referenced in function "public: virtual class CEGUI::Texture * __thiscall CEGUI::FreeImageImageCodec::load(class CEGUI::RawDataContainer const &,class CEGUI::Texture *)" (?load@FreeImageImageCodec@CEGUI@@UAEPAVTexture@2@ABVRawDataContainer@2@PAV32@@Z)
CEGUIFreeImageImageCodec_static.lib(CEGUIFreeImageImageCodec.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_ConvertTo32Bits@4 referenced in function "public: virtual class CEGUI::Texture * __thiscall CEGUI::FreeImageImageCodec::load(class CEGUI::RawDataContainer const &,class CEGUI::Texture *)" (?load@FreeImageImageCodec@CEGUI@@UAEPAVTexture@2@ABVRawDataContainer@2@PAV32@@Z)
CEGUIFreeImageImageCodec_static.lib(CEGUIFreeImageImageCodec.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_LoadFromMemory@12 referenced in function "public: virtual class CEGUI::Texture * __thiscall CEGUI::FreeImageImageCodec::load(class CEGUI::RawDataContainer const &,class CEGUI::Texture *)" (?load@FreeImageImageCodec@CEGUI@@UAEPAVTexture@2@ABVRawDataContainer@2@PAV32@@Z)
CEGUIFreeImageImageCodec_static.lib(CEGUIFreeImageImageCodec.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_GetFileTypeFromMemory@8 referenced in function "public: virtual class CEGUI::Texture * __thiscall CEGUI::FreeImageImageCodec::load(class CEGUI::RawDataContainer const &,class CEGUI::Texture *)" (?load@FreeImageImageCodec@CEGUI@@UAEPAVTexture@2@ABVRawDataContainer@2@PAV32@@Z)
CEGUIFreeImageImageCodec_static.lib(CEGUIFreeImageImageCodec.obj) : error LNK2019: unresolved external symbol __imp__FreeImage_OpenMemory@8 referenced in function "public: virtual class CEGUI::Texture * __thiscall CEGUI::FreeImageImageCodec::load(class CEGUI::RawDataContainer const &,class CEGUI::Texture *)" (?load@FreeImageImageCodec@CEGUI@@UAEPAVTexture@2@ABVRawDataContainer@2@PAV32@@Z)
CEGUIBase_static.lib(CEGUISystem.obj) : error LNK2019: unresolved external symbol _createParser referenced in function "private: void __thiscall CEGUI::System::setupXMLParser(void)" (?setupXMLParser@System@CEGUI@@AAEXXZ)
CEGUIBase_static.lib(CEGUISystem.obj) : error LNK2019: unresolved external symbol _destroyParser referenced in function "private: void __thiscall CEGUI::System::cleanupXMLParser(void)" (?cleanupXMLParser@System@CEGUI@@AAEXXZ)
CEGUIBase_static.lib(CEGUIScheme.obj) : error LNK2019: unresolved external symbol _getWindowRendererModule referenced in function "private: void __thiscall CEGUI::Scheme::loadWindowRendererFactories(void)" (?loadWindowRendererFactories@Scheme@CEGUI@@AAEXXZ)
CEGUIBase_static.lib(CEGUIFreeTypeFont.obj) : error LNK2019: unresolved external symbol _FT_Load_Char referenced in function "protected: unsigned int __thiscall CEGUI::FreeTypeFont::getTextureSize(class std::_Tree<class std::_Tmap_traits<unsigned int,class CEGUI::FontGlyph,struct std::less<unsigned int>,class std::allocator<struct std::pair<unsigned int const ,class CEGUI::FontGlyph> >,0> >::const_iterator,class std::_Tree<class std::_Tmap_traits<unsigned int,class CEGUI::FontGlyph,struct std::less<unsigned int>,class std::allocator<struct std::pair<unsigned int const ,class CEGUI::FontGlyph> >,0> >::const_iterator)const " (?getTextureSize@FreeTypeFont@CEGUI@@IBEIVconst_iterator@?$_Tree@V?$_Tmap_traits@IVFontGlyph@CEGUI@@U?$less@I@std@@V?$allocator@U?$pair@$$CBIVFontGlyph@CEGUI@@@std@@@4@$0A@@std@@@std@@0@Z)
CEGUIBase_static.lib(CEGUIFreeTypeFont.obj) : error LNK2019: unresolved external symbol _FT_Done_Face referenced in function "protected: void __thiscall CEGUI::FreeTypeFont::free(void)" (?free@FreeTypeFont@CEGUI@@IAEXXZ)
CEGUIBase_static.lib(CEGUIFreeTypeFont.obj) : error LNK2019: unresolved external symbol _FT_Get_Next_Char referenced in function "protected: virtual void __thiscall CEGUI::FreeTypeFont::updateFont(void)" (?updateFont@FreeTypeFont@CEGUI@@MAEXXZ)
CEGUIBase_static.lib(CEGUIFreeTypeFont.obj) : error LNK2019: unresolved external symbol _FT_Get_First_Char referenced in function "protected: virtual void __thiscall CEGUI::FreeTypeFont::updateFont(void)" (?updateFont@FreeTypeFont@CEGUI@@MAEXXZ)
CEGUIBase_static.lib(CEGUIFreeTypeFont.obj) : error LNK2019: unresolved external symbol _FT_Set_Char_Size referenced in function "protected: virtual void __thiscall CEGUI::FreeTypeFont::updateFont(void)" (?updateFont@FreeTypeFont@CEGUI@@MAEXXZ)
CEGUIBase_static.lib(CEGUIFreeTypeFont.obj) : error LNK2019: unresolved external symbol _FT_New_Memory_Face referenced in function "protected: virtual void __thiscall CEGUI::FreeTypeFont::updateFont(void)" (?updateFont@FreeTypeFont@CEGUI@@MAEXXZ)
CEGUIBase_static.lib(CEGUIFreeTypeFont.obj) : error LNK2019: unresolved external symbol _FT_Init_FreeType referenced in function "public: __thiscall CEGUI::FreeTypeFont::FreeTypeFont(class CEGUI::String const &,float,bool,class CEGUI::String const &,class CEGUI::String const &,bool,float,float)" (??0FreeTypeFont@CEGUI@@QAE@ABVString@1@M_N001MM@Z)
CEGUIBase_static.lib(CEGUIFreeTypeFont.obj) : error LNK2019: unresolved external symbol _FT_Done_FreeType referenced in function "public: virtual __thiscall CEGUI::FreeTypeFont::~FreeTypeFont(void)" (??1FreeTypeFont@CEGUI@@UAE@XZ)
CEGUIBase_static.lib(CEGUIPCRERegexMatcher.obj) : error LNK2019: unresolved external symbol _pcre_free referenced in function "private: void __thiscall CEGUI::PCRERegexMatcher::release(void)" (?release@PCRERegexMatcher@CEGUI@@AAEXXZ)
CEGUIBase_static.lib(CEGUIPCRERegexMatcher.obj) : error LNK2019: unresolved external symbol _pcre_compile referenced in function "public: virtual void __thiscall CEGUI::PCRERegexMatcher::setRegexString(class CEGUI::String const &)" (?setRegexString@PCRERegexMatcher@CEGUI@@UAEXABVString@2@@Z)
CEGUIBase_static.lib(CEGUIPCRERegexMatcher.obj) : error LNK2019: unresolved external symbol _pcre_exec referenced in function "public: virtual bool __thiscall CEGUI::PCRERegexMatcher::matchRegex(class CEGUI::String const &)const " (?matchRegex@PCRERegexMatcher@CEGUI@@UBE_NABVString@2@@Z)

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Static linking

Postby CrazyEddie » Fri Jan 08, 2010 09:58

The first warning seems to indicate a debug / release mode mismatch on the runtime in use. You must link the versions of the lib with the _d suffix for debug builds and the versions without the suffix for release builds.

The actual errors are because you have to additionally link the dependency libraries themselves when statically linking. This has been covered a few times on the forum already.

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 8 guests