Monday, 30 May 2011

Further frustrations and a brief moment of joy

After getting the OSX code to compile and execute using OSX (and the codeblocks/gcc combination), my next plan was to get the code to compile under Linux.

I had set up my code in a dropbox folder so I could access the same codebase across all my machines, and booted my laptop running Ubuntu 11.04.

Codeblocks started, the targets for Linux added to the project and hit 'build and run'. I sat back to watch... Screens full of error messages, top of the list was
error: invalid use of incomplete type ‘struct wxFrame’

After going round in circles, checking that the include files were present (which they were) and a few other dead ends I ended up removing and re-installing the wxwidgets libraries. It felt like a desperation move, and oddly it worked.

My code now compiled and executed as expected under Linux. Feeling brave, I started investigating getting the code to work cross-compiling for a Windows target.

Mingw libraries and utilities installed, a test program put together (another version of the infamous "Hello, World!" application) and a Hello World message box running on my Windows VM.

Getting codeblocks to use the cross-compiler wasn't difficult, a new compiler setup copied from the gcc version and changing the toolchain executables did the trick (the only bit I'm not sure about is the debugger, but when the code is compiling cleanly I'll run through that set of options).

The only gotcha was that a set of libraries are needed to have the code execute on Windows XP (I don't have other options to test at the moment - at least not while Lynn is using her computer).

No comments:

Post a Comment