[Solved] Errors linking to CEGUI libraries

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

Palaiologos
Just popping in
Just popping in
Posts: 2
Joined: Wed Aug 16, 2017 12:12

[Solved] Errors linking to CEGUI libraries

Postby Palaiologos » Wed Aug 16, 2017 13:43

Hello everybody,

I'm setting up CEGUI on my system, but I've got trouble linking my project to the libraries (both the Release and the Debug version). The problem seems embarrasingly general, but it has been puzzling me for the past days. Here is the error output (I left out the bulk in the middle, because the errors are all alike):

-------------- Build: Debug in Cathetopoly (compiler: GNU GCC Compiler)---------------

i686-w64-mingw32-g++.exe -Llib\Debug -o bin\Debug\Cathetopoly.exe obj\Debug\data.o obj\Debug\error.o obj\Debug\graphics.o obj\Debug\gui.o obj\Debug\main.o obj\Debug\map.o obj\Debug\model.o obj\Debug\prefs.o obj\Debug\terrain.o obj\Debug\tile.o obj\Debug\video.o -fmax-errors=0 -lopengl32 -lglu32 -lgdi32 lib\Debug\libCEGUIBase-0_d.dll.a lib\Debug\libCEGUICoreWindowRendererSet_d.dll.a lib\Debug\libCEGUIOpenGLRenderer-0_d.dll.a lib\Debug\libCEGUIIrrlichtRenderer-0_d.dll.a lib\Debug\libCEGUICommonDialogs-0_d.dll.a lib\Debug\libCEGUISILLYImageCodec_d.dll.a lib\Debug\libCEGUITinyXMLParser_d.dll.a lib\Debug\libIrrlicht_d.a lib\Debug\libtinyxml_d.dll.a -mwindows
obj\Debug\gui.o: In function `Z7initGUIv':
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:10: undefined reference to `_imp___ZN5CEGUI16IrrlichtRenderer15bootstrapSystemERN3irr14IrrlichtDeviceEi'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:13: undefined reference to `_imp___ZN5CEGUI6System12getSingletonEv'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:13: undefined reference to `_imp___ZNK5CEGUI6System19getResourceProviderEv'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:15: undefined reference to `_imp___ZN5CEGUI23DefaultResourceProvider25setResourceGroupDirectoryERKNS_6StringES3_'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:15: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:15: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:16: undefined reference to `_imp___ZN5CEGUI23DefaultResourceProvider25setResourceGroupDirectoryERKNS_6StringES3_'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:16: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:16: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:17: undefined reference to `_imp___ZN5CEGUI23DefaultResourceProvider25setResourceGroupDirectoryERKNS_6StringES3_'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:17: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:17: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:18: undefined reference to `_imp___ZN5CEGUI23DefaultResourceProvider25setResourceGroupDirectoryERKNS_6StringES3_'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:18: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:18: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:19: undefined reference to `_imp___ZN5CEGUI23DefaultResourceProvider25setResourceGroupDirectoryERKNS_6StringES3_'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:19: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:19: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:21: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:22: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:23: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
obj\Debug\gui.o:C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:24: more undefined references to `_imp___ZN5CEGUI6StringD1Ev' follow
obj\Debug\gui.o: In function `Z9renderGUIv':
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:32: undefined reference to `_imp___ZN5CEGUI6System12getSingletonEv'
C:/Users/sebsm/Documents/C Projects/Cathetopoly/gui.cpp:32: undefined reference to `_imp___ZN5CEGUI6System20renderAllGUIContextsEv'
obj\Debug\gui.o: In function `ZN5CEGUI6StringC1ERKS0_':
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/String.h:369: undefined reference to `_imp___ZN5CEGUI6String4nposE'
obj\Debug\gui.o: In function `ZN5CEGUI6StringaSERKS0_':
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/String.h:1263: undefined reference to `_imp___ZN5CEGUI6String4nposE'
obj\Debug\gui.o: In function `ZN5CEGUI6String6assignERKS0_jj':
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/String.h:1289: undefined reference to `_imp___ZN5CEGUI6String4nposE'
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/String.h:1292: undefined reference to `_imp___ZN5CEGUI6String4growEj'
obj\Debug\gui.o: In function `ZN5CEGUI6String6assignEPKcj':
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/String.h:1541: undefined reference to `_imp___ZN5CEGUI6String4growEj'
obj\Debug\gui.o: In function `ZN5CEGUI9EventArgsC2Ev':
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/EventArgs.h:56: undefined reference to `_imp___ZTVN5CEGUI9EventArgsE'
obj\Debug\gui.o: In function `ZN5CEGUI9EventArgsD2Ev':
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/EventArgs.h:57: undefined reference to `_imp___ZTVN5CEGUI9EventArgsE'
obj\Debug\gui.o: In function `ZN5CEGUI9EventArgsD1Ev':
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/EventArgs.h:57: undefined reference to `_imp___ZTVN5CEGUI9EventArgsE'
obj\Debug\gui.o: In function `ZN5CEGUI23InvalidRequestExceptionC1ERKNS_6StringES3_iS3_':
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/Exceptions.h:335: undefined reference to `_imp___ZN5CEGUI9ExceptionC2ERKNS_6StringES3_S3_iS3_'
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/Exceptions.h:335: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/Exceptions.h:335: undefined reference to `_imp___ZTVN5CEGUI23InvalidRequestExceptionE'
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/Exceptions.h:335: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
obj\Debug\gui.o: In function `ZN5CEGUI22AlreadyExistsExceptionC1ERKNS_6StringES3_iS3_':
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/Exceptions.h:514: undefined reference to `_imp___ZN5CEGUI9ExceptionC2ERKNS_6StringES3_S3_iS3_'
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/Exceptions.h:514: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/Exceptions.h:514: undefined reference to `_imp___ZTVN5CEGUI22AlreadyExistsExceptionE'
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/Exceptions.h:514: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
obj\Debug\gui.o: In function `ZN5CEGUI4Font23setDefaultResourceGroupERKNS_6StringE':
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/Font.h:371: undefined reference to `_imp___ZN5CEGUI4Font22d_defaultResourceGroupE'
obj\Debug\gui.o: In function `ZN5CEGUI17ResourceEventArgsC1ERKNS_6StringES3_':
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/InputEvent.h:370: undefined reference to `_imp___ZTVN5CEGUI17ResourceEventArgsE'
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/InputEvent.h:370: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
....
....
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/NamedXMLResourceManager.h:376: undefined reference to `_imp___ZN5CEGUI16ResourceEventSet14EventNamespaceE'
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/NamedXMLResourceManager.h:376: undefined reference to `_imp___ZN5CEGUI16ResourceEventSet22EventResourceDestroyedE'
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/NamedXMLResourceManager.h:365: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/NamedXMLResourceManager.h:365: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/NamedXMLResourceManager.h:365: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/NamedXMLResourceManager.h:365: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/NamedXMLResourceManager.h:365: undefined reference to `_imp___ZN5CEGUI6StringD1Ev'
obj\Debug\gui.o:C:/Program Files (x86)/mingw-w64/i686-7.1.0-posix-dwarf-rt_v5-rev0/mingw32/lib/gcc/i686-w64-mingw32/7.1.0/include/c++/bits/stl_pair.h:198: more undefined references to `_imp___ZN5CEGUI6StringD1Ev' follow
obj\Debug\gui.o:gui.cpp:(.rdata$_ZTVN5CEGUI22AlreadyExistsExceptionE[__ZTVN5CEGUI22AlreadyExistsExceptionE]+0x10): undefined reference to `CEGUI::Exception::what() const'
obj\Debug\gui.o:gui.cpp:(.rdata$_ZTVN5CEGUI23InvalidRequestExceptionE[__ZTVN5CEGUI23InvalidRequestExceptionE]+0x10): undefined reference to `CEGUI::Exception::what() const'
obj\Debug\gui.o: In function `ZN5CEGUI23InvalidRequestExceptionD1Ev':
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/Exceptions.h:304: undefined reference to `_imp___ZTVN5CEGUI23InvalidRequestExceptionE'
C:\Users\sebsm\Documents\C Projects\Cathetopoly/include/dependencies/CEGUI/Exceptions.h:304: undefined reference to `_imp___ZN5CEGUI9ExceptionD2Ev'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 1 second(s))
129 error(s), 0 warning(s) (0 minute(s), 1 second(s))



Now, here's what I've done:

1) I compiled the dependencies (0.8.x) and the CEGUI library (version 0.8.7) without encountering any errors. Compiling my project doesn't yield any serious warnings before linking.

2) I've put the right dll's, libraries and header files in my linker and compiler inclusion directories.

3) I ordered Code::Blocks to link to the debug (_d.dll.a) or release (.dll.a) version of the libraries (I've tried changing the order of the libraries to no avail)

4) I rebuilt everything from scratch at least 2 times (this included removing the residual files in the build directories before running CMake and so forth). I've also tried to exclude Irrlicht from the build (as I had some problems getting CMake to find the right libraries) without any effect.

5) I investigated the contents of the built library files using nm. For example libCEGUIBase-0_d.dll.a DOES contain a symbol '__imp__ZN5CEGUI6System12getSingletonEv'.

6) I took notice of the fact that my irrlicht libraries do link correctly (i.e. no undefined references to irr:createDeviceEx)

7) Browsed the web and this website in particular.

I'm using Code::Blocks with MingW 7.1.0 (the toolchain binaries start with the prefix 'i686-w64-mingw32'). The build configuration is the standard build with the following modifications: TinyXML instead of Expat, no D3D-rendering, Irrlicht-rendering, no D3Deffects and I'm building no SampleFramework.

My system is Windows 10, 64-bit, 8 GB, i5 quadcore. Any help is appreciated, thanks in advance!
Last edited by Palaiologos on Wed Aug 30, 2017 11:02, edited 1 time in total.

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

Re: Errors linking to CEGUI libraries

Postby Ident » Thu Aug 17, 2017 19:27

It's a bit odd since the libs are linked. Are the libs of reasonable size (not around 0kb) ?

Have you tried building the SampleBrowser?

If you manage to get the samplebrowser to run, you can simply compare the project setup to yours.

There are also the application templates, which are minimal standalone projects to build upon. You can try building that one too.
CrazyEddie: "I don't like GUIs"

Palaiologos
Just popping in
Just popping in
Posts: 2
Joined: Wed Aug 16, 2017 12:12

Re: Errors linking to CEGUI libraries

Postby Palaiologos » Wed Aug 30, 2017 11:01

Hello,

Thanks for the reply. The hint to build the Sample Framework proved to be rather helpful. As it compiled succesfully except for the irrlicht linkage (I built irrlicht as .cbp project using the toolchain in the settings). After poking about in the makefiles for two days, I found out that the 'native compiler' of CMake was different from the C::B MinGW toolchain. After changing the compiler to the newer version of MinGW (not the one supplied with C::B), the linking issue (probably a question of different name mangling) was resolved and everything compiles.

Thanks!

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

Re: [Solved] Errors linking to CEGUI libraries

Postby Ident » Sat Sep 02, 2017 22:19

I m glad you got this worked out ;)
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 1 guest