Using Eclipse for C++

For over 2 weeks, I’ve been writing code using Emacs. To see what writing C++ in an IDE was like, I tried writing a simple “Hello World” in Eclipse and when I hit run, I was getting an odd “Launch failed. Binary not found” message. I googled that exact error message and hit pay dirt.

With hindsight, the error message told me all I needed to know. The .cpp file gets compiled to a binary file i.e. object code which is executed. If you were compiling via the commandline, your commands would look like: g++ -o executableName filename.cpp and to execute, you would type ./executableName. Accordingly, your .h/.cpp file needs to be built and in Eclipse, that command is Ctrl-B or the “hammer” symbol. 

Application_launcher_110Selection_113Selection_112

Advertisements