Every Flavour Beans

“The time has come…to talk of many [technologies].” –Lewis Carroll(’The Walrus and the Carpenter’)
Development Tools. Web Frameworks. GNU/Linux. Nokia N800. Video Encoding.

December 31, 2006

Six Popular IDEs For Developing Software in C/C++ on Windows Platform

Filed under: C++ Boost — tabrez @ 11:32 pm

For all the languages getting created these days, a decent IDE seems to be created even before the development of the language reaches the final stage ;) But even after being in the academics and in the industry for more than three decades, there isn’t one consistently released, active C++ IDE project for the Windows platforms. Some names that come to mind when thinking about C++ IDEs for Windows platform are: DevC++, MinGW Studio, Emacs, Microsoft Visual Studio, CodeBlocks, Eclipse etc. Except DevC++, I use all the other C++ IDEs fairly regularly even today whenever I get to work in Windows.

1. DevC++

DevC++ C++ Programming IDE Screenshot
DevC++ is one of the most popular C++ IDEs amongst the student community as I was able to see during my visits to a few C++ forums on the Internet - 8 out of 10 people on such forums stated that they use DevC++ IDE and whole-heartedly recommend it to the others. I have heard very few complaints from such DevC++ fans, which makes me wonder why I was never able to make myself to like this development tool, DevC++ always looked ugly and unintuitive to me. Most of the C++ programmers from the student community have exactly the opposite to say about it though and it is the first choice for those who want to develop Windows applications using SDL, wxWidgets or DirectX SDK. DevC++ IDE uses MinGW port of gcc as the compiler. It is also an actively developed product though the rate at which it is developed seems to be a bit low. I have read that it is now supported on gnu/linux platform too though I have never tried it myself outside of Windows platform.

More Information & Download

2. MinGW Studio

MinGW Studio C++ IDE Screenshot
MinGW Studio is my answer to all the DevC++ fans. I like the interface of the MinGW Studio IDE very much, and it loads fast and runs fast. MinGW Studio also uses MinGW port of gcc as the back-end compiler and has good integration with wxWidgets SDK. Both DevC++ and MinGW support slightly older versions of gcc, which forces the users to compile gcc from the source if they want to use a more later version of it. The biggest factor that goes against this IDE is that the development of MinGW Studio is almost like having stopped. It seems like ages since the last useful feature was added to this product, though it is still good enough for light-weight C++ development. I have used it on both Windows and GNU/Linux and it works the same way on both the platforms(though it remains a secret why someone would use it on GNU/Linux platform).

More Information
Download
Screenshots: Windows and GNU/Linux

3. GNU Emacs and XEmacs

Emacs-GTK.png
Using Emacs as an IDE for C++ development is only for those who already know how to use emacs; otherwise it entails considerable investment in learning how to use the emacs editor(the effort will more than get paid off in the end). People coming from *nix background feel right at home using emacs for C++ development, but it is not a natural choice for those who have only Windows background with them. Remember that the achievable productivity levels with the emacs editor(for development with standard C++, not platform specific extensions) is comparable to that of Visual Studio and Eclipse IDEs, if not higher. XEmacs is a variant of GNU Emacs that is very popular on Windows.

More Information: GNU Emacs & XEmacs
Download GNU Emacs
Download XEmacs

4. Microsoft Visual C++ 2005

Visual C++ 2005 Express Edition Screenshot
Microsoft has come a long way with its support for C++ Standard since the Visual C++ 6.0 version of its popular IDE. Visual Studio 2005/Visual C++ 2005 Express Edition support the C++ Standard as good as any other popular C++ compiler and allows, to a large extent, developing pure C++ applications without bothering with Windows specific extensions. The new versions of the IDE also support keyboard commands for most of the operations, which means the usage of the mouse can be minimized by those seeking to be productive. The cost of the IDE has also come down for those who need a basic C++ IDE with no extra support for Windows specific extensions - the Express Edition is totally free of cost and Microsoft claims that it will remain to be free forever.

Visual C++ 2005 Express Edition:
Feature Tour
Download

5. Eclipse for C++ with CDT

Eclipse for C++ IDE is becoming the #1 choice for the C++ programmers as the support for this language keeps on increasing with improvements in the CDT plugin. Eclipse can be used on GNU/Linux platform too; on Windows, one needs to have gcc already installed on the system(say, MingW gcc port). Then installing Eclipse along with CDT plugin will get you ready to go. The only glitch here is that the integration between the installed gcc package and Eclipse doesn’t go smoothly for everyone(in my observation). An integrated package of [gcc port + Eclipse + CDT] should be very helpful in this case. Programmers need to write their own build scripts(eg. Makefile) to build the C++ programs in Eclipse for C++. In the long term, Eclipse for C++ should become increasingly appealing for C++ development on Windows.

More Information
Download EasyEclipse for C++

6. Code::Blocks

Code::Blocks C++ IDE Screenshot
My first choice for a light-weight C++ development environment has changed from MinGW Studio to Code::Blocks IDE in the last year. Like MinGW Studio, Code::Blocks IDE also loads and runs at good speed, uses MinGW as back-end compiler and its interface is also to my liking. Where Code::Blocks scores over MinGW Studio is the amount of development that is taking for this product: new code is added almost on a daily basis. Code::Blocks can also be used under GNU/Linux operating system.

More Information
Download
Screenshots

There are other excellent editors available that allow developing software in C++ language - like SciTE, notepad2, notepad++ etc. - but none of them support direct support to build the entire application from one place. Drop in a word if you have some other development environment for developing C++ applications that is not listed here as your favourite one under the Windows operating system.


If you want to receive future posts by email, enter your email address here:

Related Posts:

December 10, 2006

Getting Started with C++ TR1 Libraries

Filed under: C++ Boost — tabrez @ 3:03 pm

What is C++ TR1?

What exactly is C++ TR1? It is the first Technical Report on C++ Library Extensions as accepted by C++ standards committee and these library extensions will be available in the next official C++ standard to be released - C++0x. All the libraries that are a part of C++ TR1 will be included (hopefully) by the compilers once the next C++ standard is finalised and released. Mathew Austern nicely introduces C++ TR1 on the Dr. Dobbs Journal website:

The C++ Standard Library is a large and successful project. The specification of the library is about 370 pages in length[..] If a C++ program was written within the last five years, it's standard fare for it to use std::string, STL containers and algorithms, or IOStreams.
But if we look at it a little differently, the Standard Library doesn't seem so large after all. The Perl, Python, and Java standard libraries include facilities for parsing XML, performing regular expression searches, manipulating image files, and sending data over the network. From that perspective, the C++ Standard Library looks like it's only the beginning.[...] The question isn't whether we need a more comprehensive library, but how we get one. Historically, members of the Standards committee came up with two answers: Boost Libraries and C++ TR1.

The draft version of the official document describing the extensions to the C++ standard library is available for download from open-std.org website.

Does My Compiler Support C++ TR1?

But if you would like to immediately start playing with these libraries in your C++ programs without having to wait for the next C++ standard to be finalised and released, you have two options to do so.

If you are using one of the later versions of the ubiquitous GCC compiler collection(4.0 or later) on a *NIX flavour of operating system, then consider yourself lucky as the libstdc++ library that had shipped with GCC on your system might already contain a partial implementation of the C++ TR1. GCC website documents the currently supported C++ TR1 libraries. See below for some examples on compiling C++ TR1 code using the recent GCC versions.

If you are a Windows user, then you can either search for a the binary package of GCC 4.0 or later(only DJGPP seems to support the GCC 4 version; MinGW and Cygwin use older versions) or you can try to build such a version manually from the latest GCC sources. Scott Meyers describes his experience at manually building GCC on his machine and an adapted version of the same is published by MinGW website:

Testing C++ TR1 Support on Your GCC System

Fire up your favourite programming editor and enter the following code in it:

C++:
#include<tr1/array>
#include<iostream>
 
int main()
{
  std::tr1::array<int, 5> a = {{ 1,2,3,4,5 }};
  std::cout <<a[3] <<'\n';
}

If the above program compiles on your system without any complains from the compiler, then you have got the right version of gcc and libstdc++ installed on your system. You can start scanning through the TR1 libraries and testing how many of them are supported on your system. Below is just another example to test:

C++:
#include<iostream>
#include<tr1/tuple>
int main()
{
  std::tr1::tuple<int, std::string, double> t(12,"Hello", 43.56);
  std::cout<<std::tr1::get<1>(t)<<std::endl;
}

You can find more example TR1 code snippets in Austern's article or on the Boost website.

The second way is to download and use the C++ Boost Libraries, which is a collection of high quality C++ libraries including, but not limited to, the C++ TR1 libraries. You can read more about the C++ Boost libraries on the Boost website. If interested, you can browse through the installation procedure of C++ Boost on various operating systems.

New Boost Subset Package For C++ TR1

Boost has announced a new package couple of weeks back containing the subset of Boost Libraries by including only those libraries that have been accepted in C++ TR1. It is in alpha stage right now and currently going through evaluation by the community members. Those who are interested in such a library package can download it from the sourceforge.net website and give it a try. The procedure to download, install, and use the library is summarised below.

Download the alpha version of the package from the sourceforge.net website(use the latest version from the page; currently it is alpha). Extract it in your home directory, change to the extracted directory and build the package. Let us keep it in the home directory so as not to overwrite the actual Boost library installation(in case it is also installed). This way it helps in updating the package easily in the future by just deleting the contents of the directory and extracting the updated package over it when later versions of the package will be released. Set include and library paths according to the compiler that you are using. Create a sample program that uses the boost libraries(see above for some examples) and build it.

According to the (one month old) mailing list announcement, the subset includes:

Reference Wrappers Shared_ptr result_of mem_fn Function Object Binders Polymorphic Function Wrappers Type Traits Random Numbers Tuples Array Hash Functions Regular Expressions Complex Number Algorithms

For more documentation on these libraries, refer to the official TR1 document and Boost website. I will follow up with step-by-step procedure to download and install Boost C++ TR1 subset library.


If you want to receive future posts by email, enter your email address here:

Related Posts:

December 3, 2006

Is C++ really a bigger language than Java?

Filed under: General — tabrez @ 2:45 pm

Time and again I keep coming across people who complain that C++ is difficult to learn and use because it is a BIG language. Agreed that it is a bigger language when compared to something like C, but they say this when comparing it with the Java language! I don't know which versions of C++ and Java these people want to compare with each other when making such a claim(C++ around 1995 was definitely bigger than Java at the same time, but it hardly makes any sense to compare those versions of the languages today, just as it made no sense even then) but if we compare the current versions of these two languages, I don't think there is any big difference between the two in terms of number of features. Let's a have a look at the important features from the two languages in their most recent versions:

C++

Java

Types Types
Arrays Arrays
Arrays Arrays
Pointers --
Loops Loops
Functions Methods
Simple Enums Enum Types
Namespaces Namespaces
Classes Classes
Nested Classes Inner Classes
-- Anonymous Classes
Inheritance Inheritance
Multiple Inheritance --
Private & Protected Inheritance --
Operator Overloading --
Templates Generics
Exceptions Exceptions
-- Reflection
-- Boxing/Unboxing
-- Annotations
-- Threads
Variable Arguments Variable Arguments
Preprocessor --
Dynamic Memory Management Garbage Collector/finalize
Bit Fields/Bit Manipulation Bit Manipulation

I have ignored the minor feature differences from both the languages, like static import in Java and default argument values in C++ as they are too many to list here and are almost equal in number in both the languages. The above table may not suggest that both the languages are exactly the same in number of features but it definitely suggests that there isn't a big difference between the two. Java language is ready to become still bigger with Java 6 and will go through more such expansions in the next few years, where as only a small number of new features are going to be added to the C++ Language in its next standard(to be released around 2010).

I haven't included the standard libraries of these languages in the comparison, not even I/O or File streams, but the standard library of Java is clearly bigger than that of C++. It is a different case altogether with the libraries though: you need to learn only those libraries which you want to use in your applications. In that sense, the bigger the standard library, the better it is, provided that the other aspects of the libraries( usability, flexibility, extensibility, etc) are comparable.


If you want to receive future posts by email, enter your email address here:

Related Posts:


Copyright (c) 2006, 2007 Tabrez Iqbal.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. A copy of the license is included in the section entitled "GNU Free Documentation License".


Powered by WordPress
This website is hosted by Dreamhost


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser
Mobilytics