Author Topic: Execution error with wxDialog (none using wxFrame)  (Read 9610 times)

barbarello

  • Guest
Execution error with wxDialog (none using wxFrame)
« on: January 10, 2006, 01:54:11 pm »
Hi all,

I'm working with
CODEBLOCKS 1.0RC2
wxWidgets 2.6.2


When i create a wxFrame, it's work (compilation and execution) correctly
But if i create a wxDialog, the compilation return 0 error and 0 warning but the execution of exe file send a messagebox :

The process entry point _ZN8wxDialog17MSWProcessMessageEP6tagMSG not found in lib wxmsw26_gcc_cb.dll

I need to copy wxmsw26_gcc_cb.dll into a directory specified by the system 's path (windows or system32), the exe file execute without error.

I think the problem come from my compilations parameters....

Anybody already have this problem or can help me ?

Thanks a lot

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Execution error with wxDialog (none using wxFrame)
« Reply #1 on: January 10, 2006, 02:18:41 pm »
Hello,

Can you try with the latest nightly build and see if you still have your problem?

Michael

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Execution error with wxDialog (none using wxFrame)
« Reply #2 on: January 10, 2006, 02:45:11 pm »
You have the same problem as in your last thread.
http://forums.codeblocks.org/index.php?topic=1891.msg14602#msg14602

This is because you still do the same thing. You still link against the dll that comes with CodeBlocks. You should not do that.

Also, you should really abstain from copying around those dlls (in particular when using several different versions of the same dll as you apparently do), because that will certainly run you into problems sooner or later. It is very well possible that Code::Blocks ceases to function because of this, and you will not know why...

Compile your own version of wxWidgets, and either copy exactly one instance with an unambiguous name into a system path, or alternatively, keep one copy per program in the same folder as the programs that require it.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

barbarello

  • Guest
Re: Execution error with wxDialog (none using wxFrame)
« Reply #3 on: January 10, 2006, 03:34:34 pm »
Yes problem is the same.

As i explain, I need to work on my project and prefer to come back to this problem later...but the time is come.

Quote
Compile your own version of wxWidgets, and either copy exactly one instance with an unambiguous name into a system path, or alternatively, keep one copy per program in the same folder as the programs that require it.

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

Is there anyboby working with the same configuration of mine ?

Sorry for my low english level... :oops:

Thanks for helping







Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Execution error with wxDialog (none using wxFrame)
« Reply #4 on: January 10, 2006, 04:58:53 pm »
You can try Therion's wxWindows 2.6.2 build. May be it will work fine for you.

Michael

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Execution error with wxDialog (none using wxFrame)
« Reply #5 on: January 10, 2006, 05:27:28 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
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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

barbarello

  • Guest
Re: Execution error with wxDialog (none using wxFrame)
« Reply #6 on: January 10, 2006, 08:33:28 pm »
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 !! ?




Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Execution error with wxDialog (none using wxFrame)
« Reply #7 on: January 10, 2006, 08:37:18 pm »
Quote
The DLL named wxmsw26_gcc_cb.dll because the option VENDOR=cb ???
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 !! ?
No, the other one, and don't touch the path :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: Execution error with wxDialog (none using wxFrame)
« Reply #8 on: January 10, 2006, 08:38:25 pm »
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)
Life would be so much easier if we could just look at the source code.

barbarello

  • Guest
Re: Execution error with wxDialog (none using wxFrame)
« Reply #9 on: January 10, 2006, 09:24:23 pm »
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.... !!

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Execution error with wxDialog (none using wxFrame)
« Reply #10 on: January 10, 2006, 09:44:22 pm »
It's boring me to need 6 Mo of DLL for and 140 ko of exe file !!!
If a 2.5 Mb executable without any dlls is what you want, no problem. Just link statically then. :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

barbarello

  • Guest
Re: Execution error with wxDialog (none using wxFrame)
« Reply #11 on: January 10, 2006, 10:26:06 pm »
Is that mean :
My wxWIDGETS own build command line :
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0 VENDOR=my_lib
become
mingw32-make -f makefile.gcc USE_XRC=1 STATIC=1 MONOLITHIC=1 BUILD=release UNICODE=0 VENDOR=my_lib

?
« Last Edit: January 10, 2006, 10:31:39 pm by barbarello »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Execution error with wxDialog (none using wxFrame)
« Reply #12 on: January 10, 2006, 11:01:07 pm »
Yes, if you intend to build a monolithic ( = one big dll) library which includes support for XRC and does not include support for Unicode.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."