Page 1 of 1

Using wxWidgets as DLL vs Monolithis library

Posted: Fri Dec 25, 2009 3:19 pm
by Dark_Phoenix
Just a quick question...
I have been using Code::Blocks to develope wxWidgets apps for a while now with no problems. I have always used wxWidgets as a monolithic library but now I am looking into using it as DLL's to cut down on program size. I keep getting linker errors and I am not sure what I need to link against. Current errors are

Code: Select all

error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssertFailure(char const *,int,char const *,charconst *,char const *)" ([email protected]@@[email protected])|
error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssert(char const *,int,char const *,char const *)" ([email protected]@@[email protected])|\
What do I need to link against to allow compilation using wxWidgets as DLL's?

Posted: Mon Dec 28, 2009 11:26 am
by Dark_Phoenix
Well, I have gotten past this issue only to hit another. Now it seems that every time I build a project using wx as DLL's my system complains about missing msvcrt DLL's. These DLL's are present and in the correct paths too! building a project using wx as a monolithis library works fibe. I'm not sure if this is a wxWidgets poblem or an IDE problem. I am using Code::Blocks as my IDE compling with msvc toolkit 2008 and I am using widgets installed from wxPack 2.8.10.05 with all options checked from the installer (all the libs and dlls for ms and mingw gcc)

I have found very little useful information on the web about tese error messages. Anyone else ever come accross this problem or know what it is I am doing wrong?

Posted: Mon Dec 28, 2009 8:54 pm
by Frank
Since VS 2005 Microsoft did some crappy stuff with it's CRT. You need the manifests vor the DLLs. Unless the manifest from your binary matches the manifest from the dll's, they are not loaded.

Also, with VS2008 and Fixpack 1, the Compiler itself writes the wrong manifest. Points to the Dlls without Fixpack. Or something like that (don't remember exactly, was some time ago).

Maybe this is your problem. If you want to know more about this crap, google for "Manifest Hell".

Re: Using wxWidgets as DLL vs Monolithis library

Posted: Thu Jan 07, 2010 10:02 am
by kbutcher5
Dark_Phoenix wrote:Just a quick question...
I have been using Code::Blocks to develope wxWidgets apps for a while now with no problems. I have always used wxWidgets as a monolithic library but now I am looking into using it as DLL's to cut down on program size. I keep getting linker errors and I am not sure what I need to link against. Current errors are
Just to clarify something here, monolithic and DLL's have absolutely nothing to do with eachother. DLL's are a shared library deffinition, where as monolithic refers to it being the entire library instead of being chopped up in bits and pieces (modular).
So you can have a monolithic or non-monolithic DLL library. If you are going to cut down the size, I would use a modular DLL library, as this would significantly cut your program down to size if you are only using a few modules from wxwidgets.

To get back to the issue at hand, then wxpack is compiled with mingw-dw2 and the generic mingw compiler is mingw-sjlj. Hence there is no real issues when using DLL's, as they are precompiled and are usable with any compiled source code, but due to the mix up with monolithic and DLL's, I think you might be using non-shared(not DLL's), which needs to be compiled into the source of the program.
The compiler can not cross compile dw2 to sjlj without some sort of interpreter, hence your problem at hand.