I’ve recently gotten interested lately in “write once, run everywhere” apps for C++, where we don’t have the luxury of a Java or similar virtual machine. The idea behind writing in C++ is to remove the dependency of my usual Java runtime environment, and instead use the wxWidgets project to build a C++ project which can be compiled for any architecture it supports (Windows/Linux/Mac). It may also offer performance benefits. In the following guide, I wanted the wxWidgets library statically compiled so that the compilation’s end result is one stand-alone executable which requires nothing else to run.![]()
wxWidgets provides a large set of C++ libraries which will act as an intermediary between my code and operating system-specific calls, such as window handling, networking and disk access. Multi-platform support is then simply a matter of changing the wxWidgets library from one OS’s version to another.
Our ingredients:
- A Windows environment (in my case, Windows 7 Pro 64-bit)
- Eclipse 3.5 “Ganymede” with CDT Plug-in
- MinGW 5.1.6
- MSYS 1.0.11
- wxWidgets 2.8.10 source
Here’s my setup guide.



If any UBC students are on campus October 1st, Microsoft would like to invite you to join them at a “Meet the Company” info session in the Forest Sciences centre.


