Size of CEGUI Distribution

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

dakiar
Just popping in
Just popping in
Posts: 5
Joined: Sat Mar 27, 2010 10:05

Size of CEGUI Distribution

Postby dakiar » Sun Jan 31, 2016 16:22

Hello,

I have been trying to find information about this, and perhaps this is a stupid question.

But I wanted to use the CEGUI for my game, I am using lightweight libraries and SDL. But when downlaoding the latest CEGUI SDK I found the size of the CEGUI base DLL to be 34 MB + a 4 MB window render, plus a graphic library specific DLL.

Is the GUI really that huge?? or did I misunderstand something? or perhaps there is a lightweight version? The size of all my entire libraries for audio, images, XML reading, compression and another lightweight UI and so on is around 3 MB combined.

Thanks,
Dak

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: Size of CEGUI Distribution

Postby YaronCT » Sun Jan 31, 2016 21:04

dakiar: u might want to consider static linking.

lucebac
Just can't stay away
Just can't stay away
Posts: 193
Joined: Sat May 24, 2014 21:55

Re: Size of CEGUI Distribution

Postby lucebac » Sun Jan 31, 2016 22:43

CEGUI is definitely NOT that big. Recently, I used CEGUI for a little private project of my own and I had libCEGUIBase, libCEGUIOpenGLRenderer, libCEGUICoreWindowRendererSet, libCEGUISDL2ImageCodec, and libCEGUIXercesParser in use. All of the libs together had a size of about 5MB. So, there must definitely be something wrong with the files you have. You maybe picked out the .lnk files - these are the biggest ones in the SDK and are only needed by MSVC for linking CEGUI into your program. Afterwards, you only need the dlls.
You might also have used the debug libs by accident - these can be a lot bigger than the release files.

dakiar
Just popping in
Just popping in
Posts: 5
Joined: Sat Mar 27, 2010 10:05

Re: Size of CEGUI Distribution

Postby dakiar » Mon Feb 01, 2016 21:34

yaronct: I don't know how to do static linking, it gives me a lot of errors when trying, is there any documents on how to accomplish this?

lucebac: Wow how did you get it that small?? My libCEGUIBase-0.dll is 34 MB in itself ( not libCEGUIBase-0_d.dll ) did you build from source in some special way? I downloaded the SDK for mingw (cegui-sdk-0.8.4-mingw) package and that is how big the file is. Perhaps I got the wrong SDK ? It does work well though. Which version did you use ??

iceiceice
Not too shy to talk
Not too shy to talk
Posts: 33
Joined: Thu Jul 09, 2015 10:20

Re: Size of CEGUI Distribution

Postby iceiceice » Tue Feb 02, 2016 19:02

I don't know how to do static linking, it gives me a lot of errors when trying, is there any documents on how to accomplish this?


The static linking option in the official cmake script is not really maintained right now, I had a to make a bunch of changes to the codebase in order to successfully static link it, or you get lots of errors.

In the cegui-emscripten project I did make those changes but I didn't make a pull request to send them back upstream (yet). I may do that at some point. I'm not sure if the way I'm fixing it would be officially sanctioned.

Also in that project I'm not using the official cmake, I'm using a smaller, simplified one that just has a single compilation unit for the whole CEGUI lib.

As I recall these are the things that I needed to do:
1) Use the `CEGUI_STATIC` define, and also the `CEGUI_STATIC_FACTORY_MODULE` define.
2) You will get compiler errors because of some apparent programmer errors. I reported these bugs here: https://bitbucket.org/cegui/cegui/issue ... gui-static

When CEGUI builds "normally" as a collection of dynamic libs, the main lib must find the other libs at runtime and grab the appropriate symbols from them (using `dlsym`) so that they can be used. When CEGUI is instead built as one unit, instead of `dlsym` there are some global `getter` functions defined that produce references to various singleton objects, which provide the same functionality that be found via the `dlsym`.

But this part needs to be fixed up apparently, for instance, some of these getter functions are marked `extern "C"` when they cannot be `extern "C"` due to using C++ references... there is no compiler for which this code could ever have compiled. Instead such functions should be declared `extern` in a header and then defined normally in a compilation unit to return a reference, or refactored to use pointers so that they can actually be `extern "C"`.

I believe I only needed to fix up the code in this regard for the "WindowFactoryModule" and the "ImageCodecModule". Maybe also the XML parser module, I don't remember.

3) You will get link time errors because in CEGUI there are many .cpp files that have identical names. For instance, there is `src/ImageCodec.cpp`, and also, `src/ImageCodecModules/SILLY/ImageCodec.cpp`. This apparently causes problems when static linking. To fix it, I simply stick an underscore arbitrarily at the end of some of the filenames, so `src/ImageCodec_.cpp`. Since *my* cmake file works by globbing .cpp files from the source tree this makes no difference -- otherwise you probably have to update CMakeLists.txt also to reflect your changes.

I don't believe there were any other problems after that.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 8 guests