Author Topic: Error when running with wxwidget  (Read 6292 times)

Offline vayth

  • Single posting newcomer
  • *
  • Posts: 3
Error when running with wxwidget
« on: April 12, 2013, 09:34:08 am »
I don't know if it's the right place, but I've tried to ask in wx forum, but it seems people rarely around over there..

I'm using CB 12.11 with wxwidget 2.9.4, and TDM GCC 4.7.1 as the compiler

Everytime I tried to run my project, I get an error "the application was unable to start correctly 0xc000007b..."
I tried to fix it like the one mentioned here,
adding #define WX_CPU_AMD64 and link in search dir
Finally I managed to rum my project, but only from CB. If I were to run it from windows explorer, I still get the same 0xc000007b error, no matter how many time I rebuild it.

Any suggestion?
Thanks before

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Error when running with wxwidget
« Reply #1 on: April 12, 2013, 10:01:31 am »
This is no c::b related question so Off Topic... I think it will going to be locked...

anyway some hints:
are you linking it against a static or a dynamic build?
are the libraries compiled with #define WX_CPU_AMD64? Both, the library and the application have to be compiled with the same flags and defines. Why are you compiling with 64Bit?

Finally I managed to rum my project, but only from CB. If I were to run it from windows explorer, I still get the same 0xc000007b error
So it seems that in the searchpath of C::B is the right copiled version of wxWidgets for your Application... Try to copy the wxWidgets DLL from the bin of C::B to your Applicationfolder (or simply compile wxWidgets with the same flags like your Programm)

Offline vayth

  • Single posting newcomer
  • *
  • Posts: 3
Re: Error when running with wxwidget
« Reply #2 on: April 12, 2013, 10:26:55 am »
I compiled wx with the instruction written on http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef
Code
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllexport
so I guess it's dynamic?
As for why I compiled it with 64 bit, because it's TDM GCC 64 bit, maybe? Well, I don't know how to compile it with 32 bit (-m32 doesn't work with make). I'm beginner in C++, especially in GUI thing. and New WxWidget project, no additional code, just the default one, doesn't work without that wx_cpu_amd64

And about DLL things, I don't know which DLL I need, so I copy every wx*.DLL in CB folder to my application, but it didn't help..

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Error when running with wxwidget
« Reply #3 on: April 12, 2013, 10:40:03 am »
So why are you using TDM GCC 64 bit? use the normal 32Bit (specially if you are a beginner) without this wx_cpu_amd64 and you will be fine (i think). You have to recompile wxWidgets and your program.
or
try http://www.dependencywalker.com/ and look what libraries are used from your prog, and try to resolve the whole mess.... (I would prefer solution 1)

Offline vayth

  • Single posting newcomer
  • *
  • Posts: 3
Re: Error when running with wxwidget
« Reply #4 on: April 12, 2013, 11:05:47 am »
well, it's the compiler from when I used (orwell) dev cpp. The site said that if I'm not sure, just use the 64 bit one since it's capable of both 32 and 64 bit.

But, yeah, I guess I'll try to download another compiler and recompile everything..
Thanks.

Offline WardXmodem

  • Single posting newcomer
  • *
  • Posts: 4
Re: Error when running with wxwidget (which forum)
« Reply #5 on: May 08, 2013, 06:54:46 pm »
P.S. a tip: the reason the first responder said of your post: "there is no c::b related question" meant that the HELP (not GENERAL) forum is used for questions indirectly related to Code::Blocks but not specifically the (wonderful) compiler.