Author Topic: Compilation passes, but can't run.  (Read 5848 times)

Offline zouxiz

  • Single posting newcomer
  • *
  • Posts: 3
Compilation passes, but can't run.
« on: April 24, 2010, 12:07:27 pm »
Hello everyone:
I'm a newbie to CB, I created a demo with wxWidgets(a simple "hello world" app), build success but run failed.
It prompted like this:

I use the Windows XP Professional Chinese Edition, the prompt generally means "
wxHello.exe - application error
application standard initialization(0xc0000005)failure. Click "OK" to terminate it."
My develepment env: CB 8.02, mingw, wxWidgets-2.9.
It bored me for 2 days. I googled, but found nothing.
someone helps me?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7594
    • My Best Post
Re: Compilation passes, but can't run.
« Reply #1 on: April 24, 2010, 08:02:44 pm »
Did you build wxWidgets and your program with the same version of MinGW GCC and use the mingw DLL from that installation on running?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline zouxiz

  • Single posting newcomer
  • *
  • Posts: 3
Re: Compilation passes, but can't run.
« Reply #2 on: April 25, 2010, 08:50:35 am »
Did you build wxWidgets and your program with the same version of MinGW GCC and use the mingw DLL from that installation on running?

Tim S.

thanks for your response.

Yes. I'm sure I used the same version of MinGW GCC. I found there are two different mingwm10.dll files, one in mingw/bin and the other in codeblocks install dir. I replace one with the other to make them the same version but helped nothing.

Offline thynson

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Compilation passes, but can't run.
« Reply #3 on: April 27, 2010, 08:22:20 am »
This problem could be solved by pass flag --enable-runtime-pseudo-reloc-v2 to the linker(ld).
But in codeblocks, I don't know where to set this flag. In command line, I tested it and it works.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2784
Re: Compilation passes, but can't run.
« Reply #4 on: April 27, 2010, 03:03:12 pm »
What version of mingw are you using?

I found that compiling codeblocks and wxWidgets with 3.4.5 would cause this problem.

When I updated to mingw 4.+, the problem disappeared.

Offline zouxiz

  • Single posting newcomer
  • *
  • Posts: 3
Re: Compilation passes, but can't run.
« Reply #5 on: April 27, 2010, 03:36:54 pm »
What version of mingw are you using?

I found that compiling codeblocks and wxWidgets with 3.4.5 would cause this problem.

When I updated to mingw 4.+, the problem disappeared.


mingw 4.5.0-1.
:(

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Compilation passes, but can't run.
« Reply #6 on: April 27, 2010, 03:53:09 pm »
4.5 is pretty new gcc, try older one, 4.4 for example
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]