Author Topic: WxSmith "Hello Word" tutorial produces access violation (status -1073741819)  (Read 3195 times)

Offline FalconFour

  • Single posting newcomer
  • *
  • Posts: 2
Oh... I'm at wit's end. You can tell, because it took me through to registering here just to post about this.

(rant)
I just want a simple, barebones IDE to create a basic, barebones program that lets me do simple functions in a single form. Kind of like a calculator of sorts. All the IDEs out there seem to want to be "everything at once"... I work in embedded development, and I just need a simple, small program that allows me to calculate a checksum, _without_ programming a microcontroller to give me a serial interface to do the same thing. Seems stupid that I've got a whole computer right in front of me, but the only device I know how to program on is an AVR microcontroller...
(/rant)

So, enter Code::Blocks. I tried going through this tutorial:
http://wiki.codeblocks.org/index.php/WxSmith_tutorial:_Hello_world

But the tutorial drops dead at the first "build", just trying to build and display the new, blank project. No compile errors. Just the blank project fails to run, even with zero modifications (not even fixing the "close" thing). It gives no popup console window, no open/closed dialog, absolutely nothing happens at all. If I run in debug, it indicates a "segmentation fault".

Running it normally gives this in the Build Log:
Process terminated with status -1073741819 (0 minute(s), 5 second(s))

Running in debug says "Program received signal SIGSEGV, Segmentation fault".

Code
#0 0x61d276c6	wxObject::wxObject(this=0x54) (../../include/wx/object.h:412)
#1 0x6194ae40 wxEvtHandler::wxEvtHandler(this=0x54) (../../src/common/event.cpp:1031)
#2 0x618c126b wxAppConsole::wxAppConsole(this=0x54) (../../src/common/appbase.cpp:122)
#3 0x619f3b95 wxAppBase::wxAppBase(this=0x54) (../../src/common/appcmn.cpp:84)
#4 0x61961c61 wxApp::wxApp(this=0x54) (../../src/msw/app.cpp:510)
#5 0x41a0c9 PlainApp::PlainApp(this=0x1fa6930) (***/Documents/cbProjects/Plain/PlainApp.h:15)
#6 0x4013af wxCreateApp() (***\Documents\cbProjects\Plain\PlainApp.cpp:18)
#7 0x618f4255 wxEntryStart(argc=@0x28fda0: 1, argv=0x1fa6130) (../../src/common/init.cpp:273)
#8 0x618f464a wxInitialize(argc=1, argv=0x1fa6130) (../../src/common/init.cpp:479)
#9 0x61cdfb98 wxInitializer::wxInitializer(this=0x28fddf, argc=1, argv=0x1fa6130) (../../include/wx/init.h:81)
#10 0x618f4508 wxEntryReal(argc=@0x28fe2c: 1, argv=0x1fa6130) (../../src/common/init.cpp:417)
#11 0x61950e9c wxEntry(argc=@0x28fe2c: 1, argv=0x1fa6130) (../../src/msw/main.cpp:231)
#12 0x61951021 wxEntry(hInstance=0x400000, nCmdShow=10) (../../src/msw/main.cpp:386)
#13 0x401425 WinMain@16(hInstance=0x400000, hPrevInstance=0x0, lpCmdLine=0x783346 "", nCmdShow=10) (***\Documents\cbProjects\Plain\PlainApp.cpp:18)
#14 0x41aa7b main () (??:??)

There's no "main" function that I can find, either... I can't figure out for the life of me where to even begin writing code, or where to look for the problem. I Googled high and low about this, but just get people talking about complex programs and weird conditions... but nobody having a problem with a blank project with literally zero written code failing to execute as the tutorial says it should...

I followed the directions in that tutorial exactly - except I couldn't get the $(#wx) global variable to work (can't figure out how to change options for a project after exiting the wizard), so I just entered a real path. I downloaded the wxPack version 2.8.12.07 from here: https://drive.google.com/folderview?id=0B54E1bClDuSuTExoUXoyRmF0Z3c&usp=sharing - and I'd originally installed Code::Blocks without the minGW pack (not knowing I couldn't simply... install it later), so I installed the C::B + minGW pack over the top of it, then had the compiler options "autodetect" it (successfully). I'm on Windows 7 x64.
« Last Edit: March 21, 2016, 12:47:33 am by FalconFour »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7590
    • My Best Post
FYI: wxWidegets is a C++ Library!!
Therefore, when you download prebuilt binaries; you almost always have to use the exact same C++ compiler; this includes using the same version number for major and minor version.

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 FalconFour

  • Single posting newcomer
  • *
  • Posts: 2
see, this is why I do embedded development -_- There are no libraries and no binaries to even consider! I have to write all my own stuff! LOL

So... I compiled from source using the mingw tools available within the C::B program folder, and... magic, it works.  ::) (Hard to believe that a 14MB download can become about 400MB+ in the working/built folder...) (er, update: about 900MB after compiling each variant of unicode/non-unicode, debug/release!)

Seriously, why do they even provide precompiled binaries then?! LOL. Okay, well... mea culpa.

Thanks for the clue to get me on the right track!
« Last Edit: March 21, 2016, 03:27:33 am by FalconFour »