Skip to content

Alternative Windows Development Environment

jan76 edited this page Jun 10, 2013 · 10 revisions

The current and supported TauLabs development environment for Windows is found on the Windows page. If you deviate from those instructions the development environment probably won't work and you are on your own.

Motivation

This page is a collection of notes on the development environment for Windows that tries to explain how the components interact so that "unsupported" development environments can be built. It is intended to help people that are trying to configure their system to build Taulabs when they have conflicts with how the supported environment works.

The supported environment requires specific versions of tools installed to specific locations, i.e. the /tools directory. Some attempt has been made to allow tools to be accessible via the system path, however the system is quite sensitive and it is very easy to cause problems resulting in a broken development environment.

Background

The Taulabs source code uses a Makefile to build firmware, GCS, Android GCS, and various other tools. The Makefile is written in such a way that it expects to be run from a Bash style shell.

Under Linux gcc, g++ and make are usually provided as part of a compiler toolkit available to whichever distribution is in use. Under Mac OSX gcc, g++ and make are provided as part of Xcode.

Under Windows MinGW is one of the few gcc/g++ toolkist that are available. A version of MinGW's compiler toolkit is shipped with the Qt SDK. The supported method of building Taulabs uses a MinGW compiler toolkit provided by an old and unavailable Qt SDK, and piggy backs off the Msys Bash shell that ships as a part of msysGit, the binary release of Git for Windows.

To build all of the Taulabs components under Windows you need to provide a Bash like shell and a C/C++ compiler toolkit that is binary compatible with the Qt 4.8 Library you are trying to use.

Requirements

Other Useful Tools

MinGW

MinGW is the C and C++ compiler used to build the GCS and the UAV Object Generator. MinGW's port of GNU make (mingw32-make.exe) is used on Windows to process the main Makefile which includes building firmware for the various flight controller boards.

The current Taulabs is written using the Qt 4.8 SDK. Note that the Qt 4.8 Library packages distributed by Qt are built against GCC 4.4 and require a MinGW compiler toolchain that is binary compatible with GCC 4.4. It is not possible to use the MinGW compilers that are packaged as part of the Qt 5.0 SDK distribution as they are built with newer GCC (4.6+) compilers.

To build Taulabs against Qt 4.8 you have essentially two options:

  1. Install a binary distribution of Qt 4.8 and use a MinGW compiler toolchain that is binary compatible with GCC 4.4
  2. Compile Qt 4.8 from source with your preferred version of the MinGW compiler toolchain

There is a Qt 4.8 compatible MinGW binary package provided by Qt however at the time of writing it appears the latest successful build is several months old. Regardless, this is the recommended C/C++ compiler as part of this guide.

There is a page at the Qt Project that describes how MinGW is supported.

Qt Library

The Qt 4.8.4 Library is the most recent release in the 4.8 series. The default installation location for Qt 4.8.4 Library is %SYSTEMDRIVEE%\Qt\4.8.4, which is more often than not C:\Qt\4.8.4.

The default installation of the Qt Library does not add the %SYSTEMDRIVE%\Qt\4.8.4\bin directory to the system path.

Bash shell

The Makefile currently includes several commands that are specific to a bash-like shell. The majority of these include testing for the existence of a directory and then taking action upon the result.

The supported Windows build environment uses the bash shell that is packaged as part of msysGit. As git is a required tool to generate commit hashes to "sign" UAV objects and as msysGit is a common way of getting git onto a Windows system, presumably this shell was seen as a convient and "easy" way to get a Windows bash environment available to Taulabs.

The result is that Taulabs effectively has a dependence on a Msys environment (which provides a Bash shell). Msys has now been included as part of the larger MinGW installer and is now installed by mingw-get, a command line installer utility. It is recommended to install MinGW including Msys to get a standalone bash shell that is separate to the shell that is a part of msysGit.

The default installation for MinGW is to %SYSTEMDRIVE%\MinGW, which is more often than not C:\MinGW. A .bat file that will start a bash shell is then available at %SYSTEMDRIVE%:\MinGW\msys\1.0\msys.bat, which is also added to the Windows Programs menu during the MinGW install process.

Other Notes not yet sorted

QTMINGW environment variable is set in sh.cmd, and is used in the copydata .pro file to copy MinGW dlls into a release distribution