[Solved] linking cegui dlls (codeblocks/windows compilation)

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

Nyx Erebos
Just popping in
Just popping in
Posts: 10
Joined: Sun Aug 18, 2013 22:54

[Solved] linking cegui dlls (codeblocks/windows compilation)

Postby Nyx Erebos » Sun Jan 19, 2014 22:10

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.
Last edited by Nyx Erebos on Tue Jan 21, 2014 16:26, edited 1 time in total.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: linking cegui dlls (code::blocks and windows compilation

Postby Ident » Mon Jan 20, 2014 01:10

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
CrazyEddie: "I don't like GUIs"

Nyx Erebos
Just popping in
Just popping in
Posts: 10
Joined: Sun Aug 18, 2013 22:54

Re: linking cegui dlls (code::blocks and windows compilation

Postby Nyx Erebos » Mon Jan 20, 2014 12:10

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


:oops: 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...

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: linking cegui dlls (code::blocks and windows compilation

Postby Ident » Mon Jan 20, 2014 17:35

code::blocks does not produce .lib files?
CrazyEddie: "I don't like GUIs"

Nyx Erebos
Just popping in
Just popping in
Posts: 10
Joined: Sun Aug 18, 2013 22:54

Re: linking cegui dlls (code::blocks and windows compilation

Postby Nyx Erebos » Mon Jan 20, 2014 18:39

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

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: linking cegui dlls (code::blocks and windows compilation

Postby Ident » Mon Jan 20, 2014 22:11

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.
CrazyEddie: "I don't like GUIs"

Nyx Erebos
Just popping in
Just popping in
Posts: 10
Joined: Sun Aug 18, 2013 22:54

Re: linking cegui dlls (code::blocks and windows compilation

Postby Nyx Erebos » Mon Jan 20, 2014 23:34

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 :cry: ) 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 :roll: ).

The "sad" thing is that I get the examples to run so I don't know what I'm doing wrong...

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: linking cegui dlls (code::blocks and windows compilation

Postby Ident » Tue Jan 21, 2014 03:01

At this point I think I really lost all track of your approach , but I have to imagine you like this:

Image
CrazyEddie: "I don't like GUIs"

Nyx Erebos
Just popping in
Just popping in
Posts: 10
Joined: Sun Aug 18, 2013 22:54

Re: linking cegui dlls (code::blocks and windows compilation

Postby Nyx Erebos » Tue Jan 21, 2014 16:25

Yeah basically that's how I felt, I had the blank mind of an animal :rofl:

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 :lol: 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 :pint:

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: [solved] linking cegui dlls (codeblocks/windows compilat

Postby Ident » Tue Jan 21, 2014 16:29

can u tell us about the right order, so that the next person reading this will have a solution provided?
CrazyEddie: "I don't like GUIs"

Nyx Erebos
Just popping in
Just popping in
Posts: 10
Joined: Sun Aug 18, 2013 22:54

Re: [solved] linking cegui dlls (codeblocks/windows compilat

Postby Nyx Erebos » Tue Jan 21, 2014 18:17

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.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 18 guests