Using Eclipse 3.1.0 & CDT 3.0 for Qt 4.0.0 Development under Windows


Intro

Good things come to those, who can wait...
...finally, after years of waiting, Trolltech has released Qt4 for non commercial use under Windows.

So I decided to port my own applications to the Windows-world. Spoiled by KDevelop, the first thing I missed was a comfortabel IDE: Hm, how to go? Lastly I took the QSSL way. This company is distributing the embedded OS QNX with the so called Momentics-IDE, a drilled up Eclipse-platform plus the CDT-plugin ...and it woks pretty good!

This short article summarizes what you need to download, how to configure and to install for developping your Windows Qt-applications under Eclipse with the CDT using the mingw32 environment.

Overview

To get it working, I did the following steps:

MinGW

  1. First step is to download and execute the online installer MinGW-4.1.0.exe.
  2. Choose minimal package for building C/C++, full set of compiler and utilities packages. Take care, that "ming32-make" is included (Additional Tasks). I installed MinGW to "E:\MinGW".
  3. The installer will download ~50MB.
  4. Do not forget to add the "E:\MinGW\bin"-folder to your path-environment!
For test, open a dos-prompt and call mingw32-make. Normally, something like mingw32-make: *** No targets specified and no makefile found. Stop. should be prompted.

gdb from MinGW

Download and install gdb into your MinGW32-folder gdb-5.2.1-1.exe.

Qt 4.0.0

Third step is downloading the Qt/Windows Open Source Edition qt-win-opensource-desktop-4.0.0.zip , ~25MB.
  1. Unzip this file from trolltech: qt-win-opensource-desktop-4.0.0.zip
  2. Move all the files and folder under directory "qt-win-opensource-desktop-4.0.0" to a folder where you like to perform installation. In my case it was E:\Qt\4.0.0\
  3. Open command line and cd to that folder e.g. "cd E:\Qt\4.0.0\"
  4. Next type in "configure -platform win32-g++" If you need to configure further, then give the command "configure -help" and turn on/off appropriate options.
  5. Hit "y/Y" to accept the License agreement.
  6. Once Configure script ends, type in "mingw32-make"
  7. Pe patient, compiling Qt takes time ~1h @3GHz-AMD
  8. Last step is to setup a batch-file including some environments, store this file as "qtvars.bat"

Eclipse 3.1.0

Now its getting easier...
  1. Download eclipse-SDK-3.1-win32.zip, ~100MB.
  2. Unzip the archieve to root, I choosed "E:\eclipse"
  3. Create a workspace-folder, e.g. "D:\workspace". This will be your src-folder.
  4. Create a shortcut to the eclipse-executable "E:\eclipse\eclipse.exe"
  5. Start eclipse, enter your workspace-folder, quit.

CDT 3.0

Now Eclipse gets C/C++ functionality...
  1. Download org.eclipse.cdt-3.0.0-RC1-win32.x86.zip, ~100MB.
  2. Extract the archieve.
  3. Copy or move the contents of the extracted archieve into your eclipse-folder (features to features and plugins to plugins).

Configuration & Test

This was an installation spree...so let`s test it: