Developer Setup for Windows with MinGW32 and Eclipse

Configuring your Windows machine to compile XCSoar using the MinGW compiler and the Eclipse development environment

Note: This creates just the PC/Windows version of XCSoar, not the versions that run on a PDA, PNA or Altair.

Another Note: You don't need Eclipse to compile XCSoar under Windows. Eclipse is a development tool, that some users like for editing and debugging the project. This tutorial for setting up Eclipse is actually based on the non-Eclipse tutorial.
(Goto Advanced/Development/Setup/WindowsBasic for non-Eclipse windows setup)

1) Follow steps 1, 2 and 3 in XCSoar's instructions for the "Basic Windows Developer Setup"

  • Step 1 downloads the "Full Git" package which includes Git, MinGW Compiler, gdb debugger and many other tools we might need
  • Step 2 installs and compiles the package you just downloaded
  • Step 3 downloads the XCSoar source code.

You do not need to follow steps 4 and beyond which cover command-prompt compiling, although those steps are good to know.

If you compiled XCSoar already, please call "make clean" from the mSys console for cleaning up the compiled files.

2) Download and Install Java for Windows

If you have Java installed already skip this step.

3) Download and Install Eclipse IDE for Windows

The Eclipse IDE is an integrated development environment similar to the Microsoft Visual Studio environment, but it is open source and it runs the MinGW compiler.

I have noticed that prior versions have slightly different configuration screens, so later versions may also have differences in the configurations. The instructions below apply to the "galileo" version of Eclipse:

  • Download the current version of Eclipse (eclipse-cpp-galileo-SR1-win32.zip) from:

http://www.eclipse.org/downloads/

Attention: Make sure you downloaded the version for C/C++ Developers

  • Extract the .zip file to your C: drive. You should get a folder called "C:\eclipse\" containing the executable.
  • Run the "eclipse.exe" executable to start Eclipse. You don't have to install anything here, Eclipse runs just like that.
  • When asked for a workspace, just confirm the dialog or choose a different folder where you want your workspace to be stored.

    Important: Do NOT choose the XCSoar folder here! The workspace folder contains lots of data that is personal to your PC and should not be mixed with the XCSoar files managed by git.

4) Import the XCSoar project into Eclipse

  • After starting Eclipse, close the Welcome Screen if necessary
  • Click File > Import in the menu
  • Select General > Existing Projects into Workspace and click [Next]
  • Select the XCSoar folder (e.g. C:\xcsoar) as the root directory. Click [Finish]
  • You should now see the XCSoar source files in the project explorer

Eclipse: XCSoar project loaded in the Project Explorer

5) Adding the "Path"

To let Eclipse know where we installed the mSys/MinGW environment, we need to add it to the "path".

  • Right-click on the XCSoar project in the project explorer
  • Choose Properties from the context menu
  • Goto C/C++ Build > Environment
  • Choose "[ All configurations ]" from the drop down box in the top
  • Check whether the PATH variable already exists, if so skip this step and continue with step 6.
  • If no PATH variable is set yet, click on Add...

Eclipse: Adding the PATH variable

  • Fill the Form with these:

    Name: PATH
    Value: C:\msysgit\mingw\bin;C:\msysgit\bin
  • Click OK, and close all dialogs

6) Compile/Build XCSoar

  • Click on the "hammer icon" (Build) in the toolbar and choose one of the configurations, for compilation and linking of the appropriate files to generate the executables.

Eclipse: Build icon

  • Click Run > Run As to launch XCSoar. (Choose XCSoar-ns.exe)

If you are asked for a debugger, choose the MinGW gdb Debugger

Next steps

Attachments