Problems with CEGUI_STATIC, well, running CEGUI at all

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

User avatar
sipickles
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Fri Feb 24, 2006 19:41
Location: Enfield, UK

Problems with CEGUI_STATIC, well, running CEGUI at all

Postby sipickles » Mon Jul 07, 2008 07:47

Hi,

Firstly, MSVC2005, CEGUI 0.6.1, prebuilt binaries.

I am trying to statically link to the CEGUI libs. I have defined CEGUI_STATIC before #include "CEGUI.h", and added CEGUIBase_d.lib and DirectX9GUIRenderer_d.lib to the linker inputs.

When I run, the app still wants to load the DLLs, which is not what I expected. If they are present in the path, I get the dreaded SxS error:

Code: Select all

Loaded 'X:\simon\Dev\wc_client\trunk\client\bin\debug\CEGUIBase_d.dll', No symbols loaded.
LDR: LdrpWalkImportDescriptor() failed to probe x:\simon\Dev\wc_client\trunk\client\bin\debug\CEGUIBase_d.dll for its manifest, ntstatus 0xc0150002


I'd like to avoid using the DLLs and just static-link. What am I missing?

Many thanks!

Simon
Last edited by sipickles on Tue Jul 08, 2008 12:37, edited 1 time in total.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Mon Jul 07, 2008 08:16

Hi,

you should link to the static versions, which are:

-CEGUIBase_Static_d.lib
-DirectX9GUIRenderer_Static_d.lib

Those should not have references to DLLs :)

HTH.
Check out my released snake game using Cegui!

User avatar
sipickles
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Fri Feb 24, 2006 19:41
Location: Enfield, UK

Postby sipickles » Mon Jul 07, 2008 13:04

Ok, that helped a little.

Now I have these link errors:

Code: Select all

Linking...
   Creating library ..\..\lib\GUI.lib and object ..\..\lib\GUI.exp
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
CEGUIBase_Static_d.lib(CEGUIFactoryModule.obj) : error LNK2019: unresolved external symbol _registerFactoryFunction referenced in function "public: void __thiscall CEGUI::FactoryModule::registerFactory(class CEGUI::String const &)const " (?registerFactory@FactoryModule@CEGUI@@QBEXABVString@2@@Z)
CEGUIBase_Static_d.lib(CEGUIFactoryModule.obj) : error LNK2019: unresolved external symbol _registerAllFactoriesFunction referenced in function "public: unsigned int __thiscall CEGUI::FactoryModule::registerAllFactories(void)const " (?registerAllFactories@FactoryModule@CEGUI@@QBEIXZ)
DirectX9GUIRenderer_Static_d.lib(d3d9texture.obj) : error LNK2019: unresolved external symbol _DXGetErrorString9A@4 referenced in function "public: virtual void __thiscall CEGUI::DirectX9Texture::loadFromFile(class CEGUI::String const &,class CEGUI::String const &)" (?loadFromFile@DirectX9Texture@CEGUI@@UAEXABVString@2@0@Z)
..\..\lib\GUI.dll : fatal error LNK1120: 3 unresolved externalsLinking...


I have linked to these:

Code: Select all

d3dx9d.lib
d3d9.lib
dxguid.lib
dxerr.lib
CEGUIBase_Static_d.lib
DirectX9GUIRenderer_Static_d.lib
CEGUITinyXMLParser_d.lib
winmm.lib
FreeType.lib
pcre_d.lib


and tried adding:

Code: Select all

#define CEGUI_STATIC
#define CEGUI_WITH_TINYXML
#define CEGUI_FALAGARD_RENDERER
#define CEGUI_CODEC_SILLY


Ow, my head! :shock:

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Mon Jul 07, 2008 13:29

It seems like you're missing the Falagard lib:

CEGUIFalagardWRBase_Static_d.lib

which is responsible for rendering actual cegui widgets.

And you need dxerr9.lib, the one without a number is the DX10 version, IIRC.

Good luck!
Check out my released snake game using Cegui!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Mon Jul 07, 2008 13:30

try linking:

Code: Select all

CEGUIFalagardWRBase_Static_d.lib
(or something, though I thought this was automagically done - not sure :P)

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Mon Jul 07, 2008 13:31

Gah! Beaten by 1 minute :lol:

User avatar
sipickles
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Fri Feb 24, 2006 19:41
Location: Enfield, UK

Postby sipickles » Mon Jul 07, 2008 13:49

I'm trying to build CEGUI into my own DLL, and hoped static linking would simplify this a little.

It builds the DLL but my app cannot load the generated DLL (manifest error again).

Using depends.exe shows that my DLL still depends on CEGUITINYXMLPARSER_D.DLL which in turn depends on CEGUIBASE_D.DLL.

Is this why my my DLL wont load?

Thanks for your patience with my problems....

User avatar
sipickles
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Fri Feb 24, 2006 19:41
Location: Enfield, UK

Postby sipickles » Mon Jul 07, 2008 18:56

Well, I noticed I was linking to freetype.lib, not freetype_d.lib.

This removed the warning I was getting about conflicting libraries. Did it help the Side-bySide issue? Nope!

Do I need to worry about the 251 warnings I get saying:

warning LNK4099: PDB 'vc80.pdb' was not found with 'x'

where x is all the CEGUI libs I've statically linked to.....

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Mon Jul 07, 2008 19:42

I'm not sure about the warnings.

With regards to the remaining DLL dependency, this will be because you link against 'CEGUITinyXMLParser_d.lib' is there not a static version of this? I'm not sure as I don't use Windows much, and the static build support even less.

If there is not a static version of the Tiny XML parser module, you might have to either switch to something else (I think Expat has a static version), or hack a little to create a static tiny.

CE.

User avatar
sipickles
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Fri Feb 24, 2006 19:41
Location: Enfield, UK

Postby sipickles » Tue Jul 08, 2008 07:30

Hmm, there is a static copy of TinyXML, but using this has no effect. CEGUIExpatParser_Static_d.lib has the same effect - Failed to probe DLL for its manifest.

I notice the DLL loads fine until I add the line:
CEGUI::DirectX9Renderer* myRenderer = new CEGUI::DirectX9Renderer( m_device->Get(), 0 );

Then the DLL Hell kicks in.

So currently, I am linking to:

d3dx9d.lib
d3d9.lib
dxguid.lib
dxerr9.lib
CEGUIBase_Static_d.lib
CEGUIExpatParser_Static_d.lib
CEGUIFalagardWRBase_Static_d.lib
DirectX9GUIRenderer_Static_d.lib
winmm.lib
pcre_d.lib
freetype_d.lib
expat_d.lib

The last three are the dependencies. I need to link to these to get it to compile - is this correct? How come these don't have static versions?

I think I am close to nailing this. I'd be sorry to give in and move the GUI system into my exe. Using a DLL makes patching so easy, in theory! ;)

User avatar
sipickles
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Fri Feb 24, 2006 19:41
Location: Enfield, UK

Postby sipickles » Tue Jul 08, 2008 08:02

Here's a hunch

My app is compiled using multibyte character set. Do the prebuilt CEGUI libs use unicode?

Could that be it?

Thanks

Si

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Tue Jul 08, 2008 08:22

sipickles wrote:The last three are the dependencies. I need to link to these to get it to compile - is this correct? How come these don't have static versions?

We did not provide static versions of those in order that we did not potentially complicate licensing further. Perhaps we may include them in future versions if enough people ask :)

Not sure about the MBCS thing, we probably use whatever the default is. I'll let scriptkid give the definitive answer to this though.

CE.

User avatar
sipickles
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Fri Feb 24, 2006 19:41
Location: Enfield, UK

Postby sipickles » Tue Jul 08, 2008 08:47

I take it you would recommend dynamic linking over static?

User avatar
sipickles
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Fri Feb 24, 2006 19:41
Location: Enfield, UK

Postby sipickles » Tue Jul 08, 2008 11:36

My problem is with CEGUIBase_d

Whether I use static or dynamic linking, this where the SxS error is caused. I have (temporarily) abandoned making CEGUI a dependency of my own DLL, and now link to it in the executable, just to try and find the cause of this.

Dependency walker can see the functions inside CEGUIBase_d.dll, but says:

Code: Select all

Error: The Side-by-Side configuration information for "x:\simon\dev\wc_client\trunk\client\bin\debug\CEGUIBASE_D.DLL" contains errors.


This is with DLLs built from source. :(

Obviously, the exe fails at run time. Save me Scriptkid! :)

----------------

EDIT

I should've checked the samples earlier. I can build all the VC2005 libs, DLLs and samples from source without any (major) incident.

None of the samples will work though.

So its my machine setup or something. I don't get how there can be aprobem when I am building everything from the same source :(

I must move on soon, either with or without CEGUI (hopefully with)

--------------

EDIT 2

I tried using CEGUIBase_d.dll from a previous project where I had built CEGUI some time ago. This WORKED! However, its dependent on d3dx9_31.dll, not d3dx9_38.dll which is my SDK.

So what is different about my setup now? It has had a reformat since. I have DXSDK June 2008 (rather than october 2007), Windows SDK (not Platform SDK - perhaps a clue?), but stil MSVC2005 as before.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Wed Jul 09, 2008 08:36

Hi,

at home i will try to run some static samples again. I know i did this to test the SDK's, but there might have been DLL files in the same folder. So i will re-run the test without any DLLs in the path.

The SDKs are build with MBCS, which is the default.
Check out my released snake game using Cegui!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 18 guests