Here is a summary of the most important steps:
- Download and install a JDK version 8 (Java Development Kit)
- from http://www.oracle.com/technetwork/java/javase/downloads/index.html, go to "JDK Download"
- Run the installer
- Check on the command line: java -version
- If it says "command not found" or similar try this: Add the bin\ directory (e.g. C:\Program Files\Java\jdk1.8.x_xx\bin) of the installed JDK to the PATH environment variable, as described here: http://www.java.com/en/download/help/path.xml
- Download Eclipse IDE for C/C++ Developers from http://www.eclipse.org/downloads/ (same bit version as for the JRE, i.e. 32 or 64 bit) and unzip e.g. to C:\dev\eclipse
- Download and install a C/C++ compiler (you will need gcc) for Windows,
- e.g. MinGW (alternatively Cygwin): for MinGW read http://www.mingw.org/wiki/Getting_Started or http://www.mingw.org/wiki/InstallationHOWTOforMinGW
- In the MinGW Installer choose "Basic Setup" and then the following packages:
- add the bin directory (e.g. C:\MinGW\bin) to the PATH variable, as before in 1.
- Check on the command line: gcc
- You should get: gcc: fatal error: no input files. compilation terminated. (this means gcc is found!!!)
- Start Eclipse with eclipse.exe. Then:
- File > New > C Project
- Enter a project name of your choice e.g. "helloworld"
- Select project type "Hello World ANSI C Project" and toolchain "MinGW GCC"
- Edit the source file:
- Initially build the project: either press Ctrl+B or click the "Hammer" button or right click the project and click "Build Project"
- Click the "Run" button. That's it!
#include <stdio.h> int main(void) { printf("C/C++ on Eclipse...\n"); return 0; }
No comments:
Post a Comment