"launching 'project' has encountered .." , project file does not exist

10,438

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.

Share:
10,438
ERJAN
Author by

ERJAN

data scientist, k8s, python, devops

Updated on June 21, 2022

Comments

  • ERJAN
    ERJAN almost 2 years

    I wanted to write 'hello world' in eclipse c++, but it does not work

    table

    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?

    u

  • ERJAN
    ERJAN about 10 years
    omg, 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
    gsamaras about 10 years
    So did I, when I first used Eclipse! Happy that I helped. :)
  • ERJAN
    ERJAN about 10 years
    what 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
    gsamaras about 10 years
    Your program must have only one function, named main. -the main function of the program-.