Wednesday, December 23, 2009

Easy guide on how to setup a C++ project from existing source

I am not a fan of C and C++, mainly because i could never quite work with pointers easily. Therefore I always try to use C# or Java instead in applications I write. But I just got a tough assignment on data mining and because the only example project that I could find which fits my requirements was in C++ I had to try and remember what I learnt in level 2 and setup a C++ project with the example source code.

My preferred IDE is Eclipse (mainly for Java) but when I tried configuring Eclipse for C++ I found the process to be extremely tedious. I just wanted to test the example C++ code so I didn't want to waste time configuring Eclipse just to do that. So instead I downloaded Visual Studio C++ and I had the example C++ code running within minutes.

Here's the step by step guide for setting up a C++ project.

1. Download and install Visual Studio C++ if you don't have it already. (you can get the Express Edition on a 30day free trial from here )

2. Run the IDE and go to File -> New -> Project from Existing code.

3. You will get the following screens. Simply follow the instructions given under each screen image.

this is the first screen you get. select the folder that contains the C++ source code as the 'Project File Location'. Give a name to the project and click next.

In this screen make sure you set the correct 'Project Type' (eg: Windows Application or Console Application). Click next.

When you get this screen just keep on clicking on next to setup the project with the default configurations. Finish when its done.

And thats it!:)