I am trying to get a wxWindows program to load a shared library (.so) using wxDLLLoader. When I create my wxWindows (2.4.1) environment using --enable-shared option of ./configure, and build the main "loader" program and the shared library using wxmsw241.dll, then everything works like a charm. If I create the wxWindows environment using --disable-shared so that wx stuff gets statically linked with the main program and the shared library (which contains wxWindows widgets etc.), then I can't get the main program to function properly. It does still load the shared library, but as soon as I make a function call from the shared library, the main program crashes with the following message:
"Instruction at 0x64ba79cf referenced memory at 0x0000000c. The memory could not be read."
Does anyone have an idea why linking wxwindows as an external DLL works but statically linking it does not?
upCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
3. Re: dll vs. static linking.
#3226
Posted by: 2004-01-13 01:47:57
That looks like a nice sample program. Thanks for pointing it out to me. I have one question on it though. Where are the plugins getting unloaded when the program is exited? I don't see any unloading done in the program. The program only uses "LoadLibrary" function. Does wxWindows take care of the unloading automatically somehow or is it just a bug in the sample program?
There doesn't seem to be any documentation on wxPluginLibrary. I guess I need to dig into the wxWindows source code to figure out what it does and how to use it, etc...
4. Re: dll vs. static linking.
#3227
Posted by: 2004-01-13 01:51:08
OOps!! I meant to say wxPluginManager. Sorry about that. By the way, I referred to this URL to see if there is any documentation: