Static Linking Issues

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

Wizzard
Just popping in
Just popping in
Posts: 1
Joined: Fri Jun 28, 2013 07:29

Static Linking Issues

Postby Wizzard » Fri Jun 28, 2013 07:45

Hello,
I have encountered two separate problems with my initial attempt to use CEGUI 0.8.2.

1.) I am trying to build my project with CEGUI linked statically using TDM-GCC, a compiler suite derived from MinGW. However, I get the following error:

Code: Select all

libCEGUIBase-0_Static.a(Scheme.cpp.obj):Scheme.cpp:(.text+0x548): undefined reference to "getWindowFactoryModule"

Also, I noticed that the ONLY code in the project that has the string "getWindowFactoryModule" in it is in the following two segments of Scheme.cpp:

Code: Select all

#if defined(CEGUI_STATIC)
extern "C"
{
CEGUI::FactoryModule& getWindowRendererFactoryModule();
CEGUI::FactoryModule& getWindowFactoryModule();
}
#endif

Code: Select all

#if !defined(CEGUI_STATIC)
            // load dynamic module as required
            if (!(*cmod).dynamicModule)
                (*cmod).dynamicModule = CEGUI_NEW_AO DynamicModule((*cmod).name);

            FactoryModule& (*getWindowFactoryModuleFunc)() =
                reinterpret_cast<FactoryModule&(*)()>(
                    (*cmod).dynamicModule->
                        getSymbolAddress("getWindowFactoryModule"));

            if (!getWindowFactoryModuleFunc)
                CEGUI_THROW(InvalidRequestException(
                    "Required function export "
                    "'FactoryModule& ""getWindowFactoryModule()' "
                    "was not found in module '" + (*cmod).name + "'."));

            // get the WindowRendererModule object for this module.
            (*cmod).factoryModule = &getWindowFactoryModuleFunc();
#else
            (*cmod).factoryModule = &getWindowFactoryModule();
#endif

As far as I can see, getWindowFactoryModule is not something that comes in CEGUI. How do I define it?

2.) The following warnings are given by the compiler:

Code: Select all

PropertyHelper.h:329:42: warning: unknown conversion type character 'l' in format [-Wformat]
PropertyHelper.h:329:42: warning: too many arguments for format [-Wformat-extra-args]

PropertyHelper.h:337:49: warning: unknown conversion type character 'l' in format [-Wformat]
PropertyHelper.h:337:49: warning: too many arguments for format [-Wformat-extra-args]

I'm not sure if these are okay or not. They seem to be caused by the usage of %llu in snprintf.

Edit: I tested whether the code still performs as intended and it does.

mmatt
Just popping in
Just popping in
Posts: 3
Joined: Sun Jul 07, 2013 13:01

Re: Static Linking Issues

Postby mmatt » Sun Jul 07, 2013 14:22

Hi Wizzard,
I've also been experimenting with static linking the development branch and discovered the same problem with getWindowFactoryModule. It used to be exported by cegui/include/CEGUI/CommonDialogs/Module.h, but was removed 6 weeks ago. There looks to be some fairly heavy refactoring going on...

I think you should be ok to comment out the undefined reference for now, it was only recently added anyway (since 0.7). I'm hoping it will be resolved at some point in the future.

Matt

User avatar
DivideStudio
Just popping in
Just popping in
Posts: 1
Joined: Thu Jun 14, 2012 13:40
Location: Bristol, UK
Contact:

Re: Static Linking Issues

Postby DivideStudio » Mon Jul 15, 2013 17:59

Hi Wizzard

You could try and define something like this in FactoryModule.cpp:

Code: Select all

extern "C"{
CEGUI::FactoryModule& getWindowFactoryModule()
{
    static CEGUI::FactoryModule mod;
    return mod;
}
}


Should work :)


Return to “Help”

Who is online

Users browsing this forum: Baidu [Spider] and 5 guests