Saturday, January 16, 2010

C/C++ on Windows 7 using Eclipse

If you got a "Launch Failed. Binary Not Found" error while running C/C++ project in Eclipse on a Windows 7 machine then you are not the only one. I came across similar problem and I have tried my best to give a terse solution. The reason for this issue might be because  Eclipse doesn't understand the 64 bit binaries generated by our Windows 7 Though,  I'm not sure. Okay, back to our problem. 


The quick steps that are to be followed to run a C/C++ program on Windows 7 are: 

1. We need compiler for Windows for this we are going to install  the following:


Open exe->Choose download and install-> install Current package->Check MinGW tools, g++ compiler, MinGW make-->install path C:\MinGW->Finish. 


(b) Minsys 


Open downloaded exe-> folder C:\msys\1.0-->For MinGW path give C:\MinGW-> Finish.


2. We set the Path (Environment variables) for these compilers: 
Append following to your Path variables (*can be located in the Advanced tab of System in the control panel under the Environment Variables option - Google it if you still can't locate it)


;C:\msys\1.0\bin;C:\mingw\bin


3. Installing CDT plugin to your existing Eclipse: 


Software Update link is: http://download.eclipse.org/tools/cdt/releases/galileo


4. Create a new  project and run the Helloworld file. 


Done ! 


Post any queries you might have. 
Enjoy!!!