GrblController is built using the Qt framework. Building for most platforms is straightforward except for Mac OSX 10.5 32 bit (Core Duo).
Qt is a cross-platform development system and libraries developed by Nokia for creating mobile apps but also desktop applications. For our purposes, we only care about the desktop app capability. You must be able to code in C++ to develop in this framework. In addition, Qt provides a simplified safe multithreaded event messaging system using “signals and slots”. If you plan on writing a windowed application with more than just the main window (i.e. settings dialog, worker thread, etc.) you should become familar with how signals and slots work, otherwise your app stands a very good chance of crashing for unknown reasons.
Qt Desktop supports Windows, Mac and Linux (Ubuntu, Debian and others), not any of the embedded or mobile varieties (even though they are typically included in the Qt development install.
GrblController will compile under various versions. It has been tested on Qt SDK 4.7 but currently is being compiled with version 4.8 on the three platforms. Update: The latest code also compiles and runs with 5.0.2 (tested under Ubuntu).
Static Build Issues
The ideal is to have a single executable with no dependencies of special libraries. These instructions will focus on the dynamic build approach because (a) the Qt Creator IDE is already setup for dynamic builds and (b) you don’t have to build the static libraries from the source yourself, which can be a herculean task. Unfortunately, using dynamic builds means that you need to distribute some helper libraries with your application, which can balloon the size of your distributable by over 10 MB.
Installers for your application
Qt provides a basic install-making tool to distribute your application, however, other installers can be used.
Qt can leverage existing compilers or use open source, so for example, it can use XCode on the Mac or g++, likewise, it can use Visual Studio on Windows or g++/mingw.
Mac: Libraries vs. SDK
You have the option to install the libraries or the SDK (this is due to the way the Mac works) – Windows or Linux are simpler in that you just install the libraries (aka the SDK). On the Mac, libraries are automatically placed into a specific location and are used for building your app usually via a makefile, whereas the SDK allows you to install a small range of library versions into a user-chosen location along with Qt Creator and Qt library source. Qt Creator automatically detects the libraries that were installed via the SDK. The Qt library source can be used to create static libraries. Use the Qt Creator that comes with the SDK, don’t install the standalone Qt Creator.
What I have discovered is that it is difficult or impossible to create 32 bit compiles with the 64 bit tools (even though the documentation implies it is possible). The only option that worked was to install the 4.7.3 carbon libraries off the Nokia ftp server and create a makefile from your pro file (instructions later in this document). Running the makefile allows you to create a 32 bit executable for older Macs. I have not been able to create PPC builds, only Intel, but PPC should be possible if additional libraries are installed. The “carbon” libraries are those specifically compiled for 32 bit Mac OSX. I include the 32 bit build option here because I assume some people may have older Mac Minis or laptops that they are ok with using in the shop near their CNC.