User forums > Help

Execution error with wxDialog (none using wxFrame)

<< < (2/3) > >>

thomas:

--- Quote from: barbarello on January 10, 2006, 03:34:34 pm ---I believe,that's what i've made...But i really sure this error is due to my compilation parameters.

I followed point per point this link :
http://wiki.codeblocks.org/index.php?title=Compiling_wxWidgets_2.6.1_to_develop_Code::Blocks_%28MSW%29

--- End quote ---
The instructions in this article are for building wxWidgets to compile Code::Blocks.

There is nothing wrong with using these libraries for other programs -- except one very important thing.
The VENDOR variable. If you look at your dll's name, you will see that it is still called wxBlahBlah_cb_Blah.dll, i.e. it has the exact same name as the library used by Code::Blocks. This is a problem because two libraries have the same name, but different layouts.
It gets worse if you have a few copies lying around somewhere else in the system path.

If Code::Blocks or any of your self-compiled programs is started, the loader will look for a dll with that name, and it will pick the first one it can find. Which one is found first depends on the dll location, the user and system path settings, the OS version, and the moon phase -- it is a nightmare.

Imagine you install some program that modifies the path variable. Then it might happen that the loader suddenly chooses a dll from another location with the same name but a different layout. That would mean that all of your self-made applications (and Code::Blocks, too) suddenly stop working. You did not change anything, you have no idea why, it just does not work. This is a really nasty condition, and you want to avoid that.
I had a simiar incident once after installing cygwin. The next morning, I turned on the PC, and gaim crashed immediately after startup. There was no apparent reason for that. It crashed every time right after startup. I ran virus scans, reinstalled gaim, I even tried kicking my PC, but that did not help either.
After several days, I found out that it was not gaim's fault at all... Cygwin had silently installed a bad version of zlib.dll in the system path.

So... the solution is to build your own wxWidgets with an unambiguous name (see VENDOR) and either keep exactly one copy in the system path, or distribute one copy with every program.

barbarello:
You are really a nice guy to help me !

If I understand correctly :

I need to rebuild my wxWIDGETS with another VENDOR option in command line :
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0 VENDOR=cb

But i don't know what are the possible options.....
The DLL named wxmsw26_gcc_cb.dll because the option VENDOR=cb ???

Then each time i'll make a new program I had to add the DLL wxmsw26_gcc_cb.dll with the exe file, and change the system path !! ?



thomas:

--- Quote ---The DLL named wxmsw26_gcc_cb.dll because the option VENDOR=cb ???
--- End quote ---
Yes


--- Quote ---Then each time i'll make a new program I had to add the DLL wxmsw26_gcc_cb.dll with the exe file, and change the system path !! ?
--- End quote ---
No, the other one, and don't touch the path :)

yop:
You just have to put it in the same dir with your app and that *only* if you create a wxWidgets app based on the "using wxWidgets DLL" template of cb. You can build wxWidgets in numerous ways and use it the way that best fits your needs (monolithic or not, shared or static, unicode or not etc)

barbarello:
You are really great people !!

It's boring me to need 6 Mo of DLL for and 140 ko of exe file !!!

In the past i used DEV-CPP/wxWIDGETS  and I genrated exe file weighing 2.5 Mo, but don't need anything else....

It's doesn't matter....

Thanks a lot one more time Thomas, Yop, Michael etc.... !!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version