Thursday, August 4, 2011

Setup Eclipse C/C++ Development Environment under Windows

1. Install a GNU C/C++ compiler for Windows, and we have two options:
  • Cygwin, which is a Linux-like system environment for Windows.
  • MinGW, which is a minimal GNU development environment for Windows.
Since MinGW is much lighter than Cygwin, here we will choose MinGW.

After installation of MinGW, we need to setup the system environment for Eclipse to search for compilers:

  • SET PATH = D:\MinGW\bin;%PATH%
  • SET C_INCLUDE_PATH = D:\MinGW\include
  • SET CPLUS_INCLUDE_PATH = D:\MinGW\include\c++\3.2.3;D:\MinGW\include\c++\3.2.3\mingw32;D:\MinGW\include\c++\3.2.3\backward;D:\MinGW\include
2. Install the CDT (C/C++ development toolkit):
  • Open Eclipse and go to Help->Install New Software
  • Select CDT and go next to install:
3. Create a new C/C++ project:
4. Run the project and see the result:

No comments:

Post a Comment