"launching 'project' has encountered .." , project file does not exist
Solution 1
Here is what I did: File->New->C++ Project You will get a pop up window. Type the name of the project you want. Then, below it says executable and inside this folder, I have (by default I guess) Empty Project. Then click Next and Finish.
Now the project appears in the left column of Eclipse. I right click it and select New->File and name it main.cpp
The main window of Eclipse opens the file main.cpp and I write inside:
#include <iostream>
int main() {
std::cout << "Hello Erjan\n" << std::endl;
return 0;
}
Then I click on Build, it's the hammer icon in the middle of the toolbar. The code compiles and we are ready to launch it!
So, click on Run icon (3 positions right of the Build icon) and you should see the output in the console.
Solution 2
The first step, create new project and try proper toolchains. Second step, Project >> build project. Third step, right click on new executive file and run or debug it.
Comments
-
ERJAN almost 2 years
I wanted to write 'hello world' in eclipse c++, but it does not work
I go to Run configurations, what config options for c++ programs should i give?
I know I don't care about 'debug' - only 'release', but how to do that?
-
ERJAN about 10 yearsomg, thx, it works, i was thinking you just hit Run and it must work - so i was wrong assuming, "run" button will do both "build & run"
-
gsamaras about 10 yearsSo did I, when I first used Eclipse! Happy that I helped. :)
-
ERJAN about 10 yearswhat if i want to run this same code - main() in file called doggy.cpp? DOES IT HAVE TO be called main.cpp for it to run? does eclipse always look for file called main.cpp?
-
gsamaras about 10 yearsYour program must have only one function, named main. -the main function of the program-.