Page 1 of 1

Is anyone *really* statically linking to CEGUI?

Posted: Wed Oct 28, 2009 22:44
by Stefan Lundmark
Hi,

I keep running into issues with static linking. For one, my package (MSVC 2008) simply won't link (unresolved externals) to the static libs when CEGUIEXPORT is set to either import or export, so I end up with this:

Code: Select all

//#if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC)
//#   ifdef CEGUIBASE_EXPORTS
//#       define CEGUIEXPORT __declspec(dllexport)
//#   else
//#       define CEGUIEXPORT __declspec(dllimport)
//#   endif
//#       define CEGUIPRIVATE
//#else
#       define CEGUIEXPORT
#       define CEGUIPRIVATE
//#endif


CEGUI_STATIC is defined and I haven't touched anything after the premake made the solution/project files for me.
Just thought I'd mention it.

Re: Is anyone *really* statically linking to CEGUI?

Posted: Thu Oct 29, 2009 17:23
by Jamarr
Sure, lots of people are statically-linking CEGUI. I am one of them.

In regards to your issue, you did not specify the version of CEGUI you are compiling? You also did not specify the library files your project is trying to link against? Also, did you have any success getting the samples to run?

Re: Is anyone *really* statically linking to CEGUI?

Posted: Thu Oct 29, 2009 22:13
by Stefan Lundmark
CEGUI version 0.7.1 but I'm pretty sure I had to do the same change for 0.6x.

I haven't tried the samples (did a fresh new project in MSVC but it failed with the same linker errors) as it's working now with the changes I described in my first post. Just wanted to write it down incase someone else runs into the same issue, and see if anyone is statically linking. :)

Re: Is anyone *really* statically linking to CEGUI?

Posted: Tue Nov 03, 2009 19:41
by scriptkid
Hi,

'We' as in 'team' are statically linking and testing with the samples, before we ship our code and SDK's.

Can you post your VC build log some time? That could give us some insight. It almost looks like you are accidently linking a non-static file with your app. Or maybe not at all :)

Thanks.

Re: Is anyone *really* statically linking to CEGUI?

Posted: Tue Nov 03, 2009 19:53
by Stefan Lundmark
Hi scriptkid,

I'm obviously linking to the correct lib since between changing those lines and recompiling CEGUI, there's nothing else I've done and it works just fine after the commenting out those defines. I have to admit I haven't tried the samples though. I'm considering switching back to 0.6 and I'll post the build log when I do that as the "error" surely will come up again.