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

有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top