Thursday, January 26, 2012

Migrating from Visual Studio to Eclipse CDT

After working long with Mirosoft Visual Studio, it is usually very difficult to move on, work with an entirely new environment. I am too facing problems, no doubt Visual Studio is a wonderful tools, but I want to try with something new. I also work with some of the tools provided by Microchip & its just when I tried to download new IDE, I got to know they are moving on to Eclipse, wow! thats a big change, as far as I could recall, the IDE is based on Win32 & not Java. So, here I go, I decided to put away MSVC and use Eclipse CDT for the development work along with MinGW as compiler toolchain. I will also be using the GnuWin32, which is the collection of GNU utilities build to run on Windows platform natively.

The next part was to choose the opensource alternative for MFC, there are vaious to choose from, I loved Qt the most. Qt is known as a cross-platform graphical user interface toolkit. It is that, but it's also a toolkit for dealing with databases, file access, sockets, and much more. Qt is not only a concurrent of MFC. It is a full toolkit, with many features available in a simpler way than in MFC, and many that simply have no equivalent in MFC:

  • Controls: Qt is a graphical toolkit, so provides a rich set of graphical controls: labels, combo box, toggle buttons. Some of them are very sophisticated, like the listview which allow to have multi column list view with icons and toggle buttons.
  • XML: Qt provides classes to manipulate XML documents (using Sax2 or Dom). The tool is simple, powerful, complete and bug free.
  • Regular Expressions: Qt provides full support for perl-compatible regular expression. This goes far beyond the simple '?' and '*' meta-characters. Regular Expressions are a very powerful tool, to parse documents, to grep patterns inside documents, to build filters, to define masks for edit controls.
  • Multi-platform: Qt is multi-platform. It works on Windows (any of them), Unix (any of them), MacOs X and embedded platforms. You just have to recompile your code to get it working on a different platform. Except for the compiler adjustments (or limitations), you don't have to touch your code.
  • Template classes: Qt provides useful classes to handle lists, files, dictionnaries, strings, threads, etc. All of them are very powerful and very handy; more than the STL and the MFC equivalents.
  • Memory management: Qt has many facilities that makes memory management a no-brainer. Qt objects are automatically destroyed when their parent is destroyed. Many classes have an implicit sharing mechanism that relieves you from the pain of managing destruction and copy of these objects.
  • Network API: Qt features classes to help programming with Network programming: socket, dns, ftp, http.
  • Database API: Qt features classes for seamless database integration : Data aware wigets, database connection, SQL queries.
  • OpenGL API: Qt provides classes for seamless integration with OpenGL (3D accelearted) libraries.
  • Canvas: Qt provides classes optimised for handling quickly moving 2d objects, usually known as sprites.
  • Styles: It is possible to fully customize the rendering of all the Qt controls. That way, Qt emulates the style of all the available toolkits: Motif, MFC, NextStep, etc

To start with you need to download some of the tools as follows:

  • The latest build of Eclipse for C++ development, this includes CDT. Download from here.
  • Download and install the Qt build with MinGW from here.
  • Also install the Qt Integration Plugin for Eclipse, this will give you the liberty to play with Qt inside Eclipse.
  • Install the MinGW compiler, available from this location.
  • Download and install GnuWin32 packages available here.

Once you are all done with installations, you are all set to try the "Hello Eclipse !" tutorial.

1 comment:

  1. Hi Sachin,

    I have done some dev stuff for Java and now want to stay will eclipse if i can.. using C++ with the MFC doing some daring Desktop Windows API apps.. :DD

    Thanks for this useful guide! Just something to clarify for me the "Qt Build" here you mean the "Qt libraries 4.8.2 for Windows" or do you mean i need to run the installer as well?