Page 1 of 1
[Solved] linking cegui dlls (codeblocks/windows compilation)
Posted: Sun Jan 19, 2014 22:10
by Nyx Erebos
After a bit of struggling I succeded in compiling cegui and got the examples to run. Now I want to link the cegui's dlls but I can't figure out how to do it. Here's the type of errors I get :
Code: Select all
\ErebnyxEngine\GUI\GUIManager.cpp|17|undefined reference to `__imp__ZN5CEGUI16IrrlichtRenderer15bootstrapSystemERN3irr14IrrlichtDeviceE'
\ErebnyxEngine\GUI\GUIManager.cpp|19|undefined reference to `__imp__ZN5CEGUI6System12getSingletonEv'
And I've got more than 50 of these errors. I'm aware that it's a windows compilation issue rather than a cegui issue but it would help keep my sanity if someone could explain me how to link the cegui's dlls (particularly using code::blocks). I only have the dlls files and the files with the same names than the dlls but with no extensions. I don't have any .a or .lib.
Re: linking cegui dlls (code::blocks and windows compilation
Posted: Mon Jan 20, 2014 01:10
by Ident
If you use CEGUI Irrlicht you would link the following libs: CEGUI-.... Base, CoreWindowRendererSet, ExpatParser (or other), IrrlichtRenderer, SILLYImageCodec (or other), your Irrlicht libs and Irrlicht dependency libs
In your case it looks like either CEGUIrrlichtRenderer.lib or the Irrlicht libs themselves are not linked
Re: linking cegui dlls (code::blocks and windows compilation
Posted: Mon Jan 20, 2014 12:10
by Nyx Erebos
Ident wrote:If you use CEGUI Irrlicht you would link the following libs: CEGUI-.... Base, CoreWindowRendererSet, ExpatParser (or other), IrrlichtRenderer, SILLYImageCodec (or other), your Irrlicht libs and Irrlicht dependency libs

that's my problem, I don't know if I'm correctly linking the libs.
Ident wrote:In your case it looks like either CEGUIrrlichtRenderer.lib or the Irrlicht libs themselves are not linked
I don't have CEGUIrrlichtRenderer.lib, I only have CEGUIrrlichtRenderer_d and CEGUIrrlichtRenderer_d.dll. By the way I got more errors than I wrote in my previous post, I have errors with everything CEGUI related and those errors come up during the linking stage :
Code: Select all
obj\Debug\GUI\GUIManager.o||In function `GUIManager::GUIManager(CEGUI::String const&, irr::IrrlichtDevice*)':
\ErebnyxEngine\GUI\GUIManager.cpp|17|undefined reference to `__imp__ZN5CEGUI16IrrlichtRenderer15bootstrapSystemERN3irr14IrrlichtDeviceE'|
\ErebnyxEngine\GUI\GUIManager.cpp|19|undefined reference to `__imp__ZN5CEGUI6System12getSingletonEv'|
\ErebnyxEngine\GUI\GUIManager.cpp|19|undefined reference to `__imp__ZNK5CEGUI6System19getResourceProviderEv'|
\ErebnyxEngine\GUI\GUIManager.cpp|20|undefined reference to `__imp__ZN5CEGUIplERKNS_6StringEPKc'|
\ErebnyxEngine\GUI\GUIManager.cpp|20|undefined reference to `__imp__ZN5CEGUI23DefaultResourceProvider25setResourceGroupDirectoryERKNS_6StringES3_'|
\ErebnyxEngine\GUI\GUIManager.cpp|20|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|20|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|21|undefined reference to `__imp__ZN5CEGUIplERKNS_6StringEPKc'|
\ErebnyxEngine\GUI\GUIManager.cpp|21|undefined reference to `__imp__ZN5CEGUI23DefaultResourceProvider25setResourceGroupDirectoryERKNS_6StringES3_'|
\ErebnyxEngine\GUI\GUIManager.cpp|21|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|21|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|22|undefined reference to `__imp__ZN5CEGUIplERKNS_6StringEPKc'|
\ErebnyxEngine\GUI\GUIManager.cpp|22|undefined reference to `__imp__ZN5CEGUI23DefaultResourceProvider25setResourceGroupDirectoryERKNS_6StringES3_'|
\ErebnyxEngine\GUI\GUIManager.cpp|22|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|22|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|23|undefined reference to `__imp__ZN5CEGUIplERKNS_6StringEPKc'|
\ErebnyxEngine\GUI\GUIManager.cpp|23|undefined reference to `__imp__ZN5CEGUI23DefaultResourceProvider25setResourceGroupDirectoryERKNS_6StringES3_'|
\ErebnyxEngine\GUI\GUIManager.cpp|23|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|23|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|24|undefined reference to `__imp__ZN5CEGUIplERKNS_6StringEPKc'|
\ErebnyxEngine\GUI\GUIManager.cpp|24|undefined reference to `__imp__ZN5CEGUI23DefaultResourceProvider25setResourceGroupDirectoryERKNS_6StringES3_'|
\ErebnyxEngine\GUI\GUIManager.cpp|24|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|24|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|25|undefined reference to `__imp__ZN5CEGUIplERKNS_6StringEPKc'|
\ErebnyxEngine\GUI\GUIManager.cpp|25|undefined reference to `__imp__ZN5CEGUI23DefaultResourceProvider25setResourceGroupDirectoryERKNS_6StringES3_'|
\ErebnyxEngine\GUI\GUIManager.cpp|25|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|25|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|27|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|28|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|29|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
obj\Debug\GUI\GUIManager.o:C:\Desk\programming_projects\ErebnyxEngine\GUI\GUIManager.cpp|30|more undefined references to `__imp__ZN5CEGUI6StringD1Ev' follow|
obj\Debug\GUI\GUIManager.o||In function `GUIManager::initFont(std::string const&, std::string const&) const':|
\ErebnyxEngine\GUI\GUIManager.cpp|44|undefined reference to `__imp__ZN5CEGUI6System15getSingletonPtrEv'|
\ErebnyxEngine\GUI\GUIManager.cpp|44|undefined reference to `__imp__ZN5CEGUI6System14setDefaultFontERKNS_6StringE'|
\ErebnyxEngine\GUI\GUIManager.cpp|44|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|43|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|43|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|44|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
obj\Debug\GUI\GUIManager.o||In function `GUIManager::initMouse(std::string const&, std::string const&) const':|
\ErebnyxEngine\GUI\GUIManager.cpp|51|undefined reference to `__imp__ZN5CEGUI6System15getSingletonPtrEv'|
\ErebnyxEngine\GUI\GUIManager.cpp|51|undefined reference to `__imp__ZN5CEGUI6System21setDefaultMouseCursorERKNS_6StringES3_'|
\ErebnyxEngine\GUI\GUIManager.cpp|51|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|51|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|51|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|51|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
obj\Debug\GUI\GUIManager.o||In function `GUIManager::initRootWindow()':|
\ErebnyxEngine\GUI\GUIManager.cpp|58|undefined reference to `__imp__ZN5CEGUI13WindowManager12createWindowERKNS_6StringES3_'|
\ErebnyxEngine\GUI\GUIManager.cpp|58|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|58|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
\ErebnyxEngine\GUI\GUIManager.cpp|59|undefined reference to `__imp__ZN5CEGUI6System15getSingletonPtrEv'|
\ErebnyxEngine\GUI\GUIManager.cpp|59|undefined reference to `__imp__ZN5CEGUI6System11setGUISheetEPNS_6WindowE'|
\ErebnyxEngine\GUI\GUIManager.cpp|61|undefined reference to `__imp__ZN5CEGUI6Window10deactivateEv'|
\ErebnyxEngine\GUI\GUIManager.cpp|58|undefined reference to `__imp__ZN5CEGUI6StringD1Ev'|
More errors follow but not being shown.
Edit the max errors limit in compiler options...
=== Build failed: 50 error(s), 14 warning(s) (1 minute(s), 9 second(s)) ===
Now I'm trying stuff randomly, I tried to link directly the dll instead of the extensionless files (project -> build options -> linker settings -> add libraries) which is certainly a dumb idea knowing that dlls are dynamics libs. So the compiler yells at me :
Code: Select all
lib\libcegui\CEGUIExpatParser_d.dll||In function `_CRT_INIT@12':
\home\ruben\mingw-w64\src\mingw-w64\mingw-w64-crt\crt\crtdll.c|76|multiple definition of `__CRT_INIT@12'
lib\libcegui\CEGUIBase_d.dll:\home\ruben\mingw-w64\src\mingw-w64\mingw-w64-crt\crt\crtdll.c|76|first defined here
...and so on...
Re: linking cegui dlls (code::blocks and windows compilation
Posted: Mon Jan 20, 2014 17:35
by Ident
code::blocks does not produce .lib files?
Re: linking cegui dlls (code::blocks and windows compilation
Posted: Mon Jan 20, 2014 18:39
by Nyx Erebos
No, only files like CEGUIBase_d and CEGUIBase_d.dll, the lib folder is empty (btw I'm using cegui 0.7.9). I followed this tutorial
http://www.youtube.com/watch?v=j8QMTSVlBpo
Re: linking cegui dlls (code::blocks and windows compilation
Posted: Mon Jan 20, 2014 22:11
by Ident
Alright, i did not make this video and got no clue about code::blocks, so sorry for that confusion. I assume you need to link these no-extension files that i listed to you then, if this is the normal procedure.
Re: linking cegui dlls (code::blocks and windows compilation
Posted: Mon Jan 20, 2014 23:34
by Nyx Erebos
I searched a bit more and found out that it might be because I'm using MSVC versions of the libs (though I compiled them with code::blocks

) or maybe because I'm forgetting to add a flag.In which file are the flags used to compile the samples ?
There's that thing about the dw2 type compiler too, I'll retry to build the libs with the same compiler as the one I use for my project (I have a dozen of compilers on my computer to build all the parts I need

).
The "sad" thing is that I get the examples to run so I don't know what I'm doing wrong...
Re: linking cegui dlls (code::blocks and windows compilation
Posted: Tue Jan 21, 2014 03:01
by Ident
At this point I think I really lost all track of your approach , but I have to imagine you like this:

Re: linking cegui dlls (code::blocks and windows compilation
Posted: Tue Jan 21, 2014 16:25
by Nyx Erebos
Yeah basically that's how I felt, I had the blank mind of an animal
But I rejoice now, I rebuilt everything with a compiler that responds to all the needs (damn I'm impressed that there are so many different version of mingw out there) and spent the day trying to figure out another error of the same type with cAudio. And after trying numerous random things I tried the right random thing

which is switching the order of the libraries during the linking.
After a week of pain I finally get my engine to run on windows and linux, time to rest

Re: [solved] linking cegui dlls (codeblocks/windows compilat
Posted: Tue Jan 21, 2014 16:29
by Ident
can u tell us about the right order, so that the next person reading this will have a solution provided?
Re: [solved] linking cegui dlls (codeblocks/windows compilat
Posted: Tue Jan 21, 2014 18:17
by Nyx Erebos
Well I was a bit desperate so I added all the libs I could find so most of the list might be useless (I'll link every libraries I use, just in case).
Go to Project -> Build options -> linker settings and add :
libIrrlicht.a
CEGUIBase_d
CEGUIExpatParser_d
CEGUIDirect3D9Renderer_d
CEGUIFalagardWRBase_d
CEGUIOpenGLRenderer_d
CEGUIIrrlichtRenderer_d
CEGUILuaScriptModule_d
CEGUISTBImageCodec_d
tolua++_d
libBulletSoftBody.a
libBulletDynamics.a
libBulletCollision.a
libLinearMath.a
libBulletFileLoader.a
libBulletConvexDecomposition.a
libHACD.a
libcAudio.a
libOpenAL32.dll.a
libEAXLegacyPreset.a
libVorbis.a
libcAp_mp3Decoder.a
libOgg.a
And obviously there are lots of flags -L<name of the library> (though I don't know if they're necessary, I know it's bad but all the compiling tutorials are written in a way that makes me think that people don't want to teach it). I made a last error too, I added all the dlls next to the exe but don't do it, launch your program and it will ask the dlls it needs.