Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compile and run C++ with MinGW using Eclipse and CDT?

I would like to do some C++ development on Windows using Eclipse and the CDT plugin. I use Eclipse Helios SR1 and have installed the CDT plugin. I have also installed MinGW and now I wrote a simple "Hello World" in Eclipse.

hello.cpp

#include <iostream>
using namespace std;
int main()
{
    cout << "Hello World" << endl;
    return 0;
}

In Eclipse using the CDT plugin and the MinGW compiler. How can I compile my program? And how can I test run the program from within Eclipse?

like image 358
Jonas Avatar asked Oct 20 '10 14:10

Jonas


People also ask

Can I compile C on Eclipse?

Eclipse is popular for Java project development. It also supports C/C++, PHP, Python, Perl, and other web project developments via extensible plug-ins. Eclipse is cross-platform and runs under Windows, Linux and Mac OS.

What is CDT in C?

The C/C++ Development Toolkit (CDT) is a set of Eclipse plug-ins that provide C and C++ extensions to the Eclipse workbench. For more information about Eclipse, see Workbench User Guide > Concepts > Workbench. The CDT provides a C/C++ IDE that simplifies many of the same tools that you can use from the command line.

Can MinGW run C?

Install MinGW, a simple C compiler.Compiling the C code will turn the code into an executable C program. MinGW is one of the easiest options to install for Windows: Download MinGW from https://sourceforge.net/projects/mingw.


1 Answers

Does Setting up Eclipse CDT on Windows, Linux/Unix, Mac OS X work for you?

like image 86
Jay Avatar answered Sep 22 '22 01:09

Jay