Author Topic: wxWidgets Application Crash 0xc0000005  (Read 11238 times)

Offline dispy

  • Single posting newcomer
  • *
  • Posts: 3
wxWidgets Application Crash 0xc0000005
« on: February 13, 2010, 04:52:53 pm »
Good day,

I'm trying to use wxWidgets with Code::Blocks - but I've problems getting started ;-)
I have built wxWidgets following instructions from this tutorial (german): tutorial

I created the project as described there, using these pieces of code.
I can compile the program without problems, but if I start it, it crashes with 0xc0000005.

This is the Traceback (-g as compiler option)

I'm using win XP SP3 with Code::Blocks 8.02 and a self-compiled current stable version of wxWidgets, my compiler is MingW

I already asked in #codeblocks, they couldn'T help me directly and recommended to ask in the forum.


Regards,

dispy
« Last Edit: February 13, 2010, 06:34:27 pm by dispy »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: wxWidgets Application Crash 0xc0000005
« Reply #1 on: February 13, 2010, 06:06:33 pm »
Did you put a copy of the Compiler's MinGW DLL in the same folder as the EXE file created.

The error looks like the one I got when I had two MinGW DLL ("mingwm10.dll") on my system.

Note: Also, put any wxWidgets DLLs, you are using, in the EXE folder.

Tim S.
« Last Edit: February 13, 2010, 06:08:09 pm by stahta01 »
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 dispy

  • Single posting newcomer
  • *
  • Posts: 3
Re: wxWidgets Application Crash 0xc0000005
« Reply #2 on: February 13, 2010, 06:41:44 pm »
I must compiled a fresh downloaded version of wxWidgets again, following the tutorial above. This time, I didn't copy the files as I think they should match ;)

The following error appears:
Quote
C:\C++\wxWidgets-2.8.10\include\wx\platform.h|196|wx/setup.h: No such file or directory|

How to fix that? Last time I think I just copied the setup.h from include/msw/setup.h to the root  - is that the correct way?
The Tutorial doesn'T mention this error ;(

after that we'll see if the error above occurs again - I bet yes, but who knows...

MfG
dispy

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: wxWidgets Application Crash 0xc0000005
« Reply #3 on: February 13, 2010, 06:59:57 pm »
Try this to set up wxWidgets for Code::Blocks on windows: http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef

Offline dispy

  • Single posting newcomer
  • *
  • Posts: 3
Re: wxWidgets Application Crash 0xc0000005
« Reply #4 on: February 13, 2010, 07:43:45 pm »
aah very nice page, much more helpful than google results  :D

Thanks guys, you saved my evening. I love you  :mrgreen:


Regards
dispy

Offline mhamed

  • Single posting newcomer
  • *
  • Posts: 5
Re: wxWidgets Application Crash 0xc0000005
« Reply #5 on: February 15, 2010, 02:00:40 pm »
Hi every body,
I'm a new to code block and i wanna use it to develope a GUI application using the wxwidgets library,
I'm using Ubuntu 9.4 running on VirtualBox (as Virtual machine )

  • I installed the Wxwidgets successfully.
Code
# tar -xzvf wxwidgets-2.8.10.tar.gz
# cd  wxwidgets-2.8.10
# mkdir build-x11
# cd build-x11
# ../configure --with-x11 --without-gtk  --enable-no_rtti --enable-no_exceptions --disable-threads --disable-sockets --disable-joystick --disable-mdi --disable-printarch --disable-postscript --disable-resources --disable-prologio --with-zlib=builtin --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin
# make
#make install
#ldconfig
  • I installed the Code::Block successfully too.
Code
 
#apt-get install codeblocks
  • I create a new Wxwidget projects.
file -> new project -> wxwidgets project -> ...
  • I compiled this project and every thing gonna good.
  • Run the project in Linux and the project run successfully
After that i install the Arm-Linux cross compilation tool-chain to the linux as follow:
Code
# cd /opt/FriendlyArm/mini2440/source/
# tar -xzvf arm-linux-gcc-4.3.2.tgz
after unpacking the ziped file it gives me usr directory
Code
export PATH=/opt/FriendlyArm/mini2440/source/usr/local/arm/4.3.2:$PATH

After that i gone to the my code::block
Setting -> compiler and debugger -> choose the GNU ARM GCC compiler -> and under the toolchain executables change this configuration
  • c compiler                               --> arm-linux-gcc
  • c++ compiler                           --> arm-linux-g++
  • Linker for dynamic library           --> arm-linux-gcc
  • Linker for static library              --> arm-linux-ar  
  • Debugger                               --> arm-linux-qdb
  • compiler installation directory   --> /opt/FriendlyArm/mini2440/source/usr/local/arm/4.3.2
 
project -> properties -> build option
Choose release tap -> duplicated  ->and choose ArmRelease as  new name
Choose the compiler as GNU ARM GCC compiler
OK

and when i compiled ARMRelease it gives me this error

cannot find -lwx_gtk2u_richtext-2.8

I googled in the internet and find that i should add this lines to the configuration
'wx-config --cflags' to the compiler option and
'wx-config --libs'     to the linker option

I successfully add this lines to the compiler and linker as follow:

project -> properties -> build-option ->choose ARMRelease -> compiler -> other option  
project -> properties -> build-option ->choose ARMRelease -> linker -> other option

After that i got more errors :
this some of all because it is more that 2000 char and it got refused by the forumas follow:

Code
obj/ARMRelease/GUIFrame.o||In function `__static_initialization_and_destruction_0(int, int)':|
GUIFrame.cpp:(.text+0x48)||undefined reference to `std::ios_base::Init::Init()'|
GUIFrame.cpp:(.text+0x64)||undefined reference to `wxEventHashTable::wxEventHashTable(wxEventTable const&)'|
GUIFrame.cpp:(.text+0x174)||undefined reference to `std::ios_base::Init::~Init()'|
GUIFrame.cpp:(.text+0x180)||undefined reference to `wxEventHashTable::~wxEventHashTable()'|
GUIFrame.cpp:(.text+0x18c)||undefined reference to `wxEVT_CLOSE_WINDOW'|
GUIFrame.cpp:(.text+0x190)||undefined reference to `wxEVT_COMMAND_MENU_SELECTED'|
GUIFrame.cpp:(.text+0x194)||undefined reference to `wxEVT_NULL'|
obj/ARMRelease/GUIFrame.o||In function `GUIFrame::GUIFrame(wxWindow*, int, wxString, wxPoint, wxSize, int)':|
GUIFrame.cpp:(.text+0x1dc)||undefined reference to `wxStringBase::InitWith(wchar_t const*, unsigned int, unsigned int)'|
GUIFrame.cpp:(.text+0x1e4)||undefined reference to `wxFrameBase::wxFrameBase()'|
GUIFrame.cpp:(.text+0x1f4)||undefined reference to `wxFrame::Init()'|
GUIFrame.cpp:(.text+0x224)||undefined reference to `wxFrame::Create(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxString const&)'|

||=== Build finished: 534 errors, 0 warnings ===|


Could any body help me please
I don't know what can i do.

 


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: wxWidgets Application Crash 0xc0000005
« Reply #6 on: February 15, 2010, 04:52:24 pm »
# ../configure --with-x11 --without-gtk  --enable-no_rtti --enable-no_exceptions --disable-threads --disable-sockets --disable-joystick
cannot find -lwx_gtk2u_richtext-2.8
Guess why again...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: wxWidgets Application Crash 0xc0000005
« Reply #7 on: February 15, 2010, 05:09:44 pm »
Quote
Linker for dynamic library           --> arm-linux-gcc

Should that not be arm-linux-g++ ??

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 mhamed

  • Single posting newcomer
  • *
  • Posts: 5
Re: wxWidgets Application Crash 0xc0000005
« Reply #8 on: February 16, 2010, 12:50:49 pm »
Hi Tim,
Thanks for your reply
I changed the Linker for dynamic library   to          --> arm-linux-g++
and reinstall the wxwidgets with removing --without-gtk
and i still have the erreor

Question : if the library was missed how the code block compiled the program for (86 processor)using GNU GCC compiler and didn't compile for ARmGNU GCC compiler

Thanks for your help
M.Hamed

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: wxWidgets Application Crash 0xc0000005
« Reply #9 on: February 16, 2010, 02:57:42 pm »
Question : if the library was missed how the code block compiled the program for (86 processor)using GNU GCC compiler and didn't compile for ARmGNU GCC compiler
What I don't get: You are developing an ARM application (that's why you are using an ARM compiler) but want to link against wxWidgets?! To my knowledge wxWidgets is not available at all for ARM platform, but even if I am wrog, you must compile/use the ARM version of wxWidgets first.

If you don't want to use wxWidgets on ARM (which I guess is what you want to do), don't setup a wxWidgets project, but start with a simple (ARM) console project.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: wxWidgets Application Crash 0xc0000005
« Reply #10 on: February 16, 2010, 03:08:28 pm »
Question : if the library was missed how the code block compiled the program for (86 processor)using GNU GCC compiler and didn't compile for ARmGNU GCC compiler
What I don't get: You are developing an ARM application (that's why you are using an ARM compiler) but want to link against wxWidgets?! To my knowledge wxWidgets is not available at all for ARM platform, but even if I am wrog, you must compile/use the ARM version of wxWidgets first.

If you don't want to use wxWidgets on ARM (which I guess is what you want to do), don't setup a wxWidgets project, but start with a simple (ARM) console project.

I agree with the comments from MortenMacFly and please do NOT hijack threads in the future and please use the correct sub-forum.

If programming on an Arm MCU use http://forums.codeblocks.org/index.php/board,22.0.html

Note: wxWidgets needs to be Compiled by the same Compiler Setup used by the Application in nearly ALL cases. This includes PC and Embedded targets. This assumes the application uses wxWidgets.

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 mhamed

  • Single posting newcomer
  • *
  • Posts: 5
Re: wxWidgets Application Crash 0xc0000005
« Reply #11 on: February 16, 2010, 03:33:55 pm »
Quote
Question : if the library was missed how the code block compiled the program for (86 processor)using GNU GCC compiler and didn't compile for ARmGNU GCC compiler
What I don't get: You are developing an ARM application (that's why you are using an ARM compiler) but want to link against wxWidgets?! To my knowledge wxWidgets is not available at all for ARM platform, but even if I am wrog, you must compile/use the ARM version of wxWidgets first.

If you don't want to use wxWidgets on ARM (which I guess is what you want to do), don't setup a wxWidgets project, but start with a simple (ARM) console project.

Wxwidgets s support Linux/ARM Arch.for mor information u can see this linkhttp://www.wxwidgets.org/docs/embedded.htm#gettingstarted

Thanks all for ur replies and sorry for hijack put i was only need help regarding to compiling/linking my project

Thanks
M.Hamed