Using wxWidgets as DLL vs Monolithis library Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Dark_Phoenix
Knows some wx things
Knows some wx things
Posts: 48
Joined: Sat Jul 04, 2009 2:27 pm
Location: Houston, TX

Using wxWidgets as DLL vs Monolithis library

Post 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 *)" (?OnAssertFailure@wxAppConsole@@UAEXPBDH000@Z)|
error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssert(char const *,int,char const *,char const *)" (?OnAssert@wxAppConsole@@UAEXPBDH00@Z)|\
What do I need to link against to allow compilation using wxWidgets as DLL's?
Dark_Phoenix
Knows some wx things
Knows some wx things
Posts: 48
Joined: Sat Jul 04, 2009 2:27 pm
Location: Houston, TX

Post 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?
Frank
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 211
Joined: Sat Jan 01, 2005 6:19 pm

Post 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".
kbutcher5
In need of some credit
In need of some credit
Posts: 2
Joined: Thu Jan 07, 2010 9:19 am

Re: Using wxWidgets as DLL vs Monolithis library

Post 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.
Post Reply