Reprint Please specify source: http://blog.csdn.net/l1028386804/article/details/46622173
Development environment: Eclipse3.2, CDT3.1, MinGW5.1
1. Installation of Eclipse and CDT
Go to Eclipse's official site http://www.eclipse.org to download eclipse.
Install the CDT.
The full name of the CDT is C/s + + Developmenttools, a plug-in that enables Eclipse to support C/s development and health.
Enter the official site of the CDT, HTTP://WWW/ECLIPSE.ORG/CDT, then select a mirror site to download the CDT separately. When the download is complete, unzip the two compressed packages into the Eclipse folder or install them by using the plug-in method.
< note: The version number of >CDT has a strict relationship with the version number of Eclipse. Assuming that the version number is not correct, the installation will not succeed.
(You can also install the CDT with Eclipse's software update feature after Eclipse is installed, with detailed steps to take a reference to eclipse's online documentation.) )
3, installation MinGW
Today, the C + + IDE is not yet activated due to the lack of important components. This part is the compiler for C/s + +. Under Windowsos We are able to choose MinGW.
To MinGW site http://mingw.sourceforge.net, download MinGW, install.
After installation. To configure
4. Add Environment variables
Right-click My Computer, properties, advanced-environment variables--Add to System variables
Mingw_home=c:/mingw
Library_path =%mingw_home%/lib
C_include_path =%mingw_home%/include
Added at the end of the path variable;%mingw_home%/bin
5, Configuration MinGW
Because the eclipse presets are used to compile files for Make.exe, MinGw the file name of make after installation is Mingw32-make.exe
So we need to rename Mingw32-make to make!.
6. Configuring Eclipse
In order for the CDT to be compiled with MinGW, it needs to be set in Eclipse
Window->preferences->c/c++->make->newmake project->new Builder
->binary Parser Cancel Elf Parser re-election PE Windowsparser
Another issue to note is that the CDT problem, when establishing indexer for C + + files, will be stuck at 75%, and CPU occupancy is usually 100%, and the only solution to know is to turn off the indexer feature window-> Perferences->c/c++-->indexer Hook off the checkmark in front of the apply indexer to all projects.
7, create, compile C/c++project
New Project->standard make C + + project-> fill in the project name Helloc,finish.
Create a "hello.cpp" file under the project
/ * * hello.cpp */ #include <iostream> using namespace std; int main () { //Say Hello five times for (int index = 0; index < 5; ++index) cout << "helloworld!" & lt;< Endl; char input = ' I '; cout << "To exit, press ' m '" << Endl; while (input! = ' m ') { cin >> input; cout << "Just entered" << input << "You need to enter M to exit." << Endl; exit (0); }
Create a Makefile file again
All:hello.exe clean : rm hello.o hello.exe hello.exe:main.o g++-g-o Hello hello.o main.o:
Attention. The beginning of the makefile is indented with tab instead of space.
Suppose compile-time prompt No separator ... There's a problem here.
Open the Window->show view->make targets view, right-click Add make Target,target name to fill in the compile, clicking Create created successfully.
In the Make targets view, double-clicking compile runs successfully, and Hello.exe files are generated under Project Helloc. --done.
Problems:
1, the execution appears: "Launch failed no binaries" error.
2. "Error launching Builder (make-k All)" appears when build project
3, after the CDT plug-in installation is complete. C, C + + projects cannot be found in the Eclipse New Project Wizard.
See a lot of friends on the Internet when using ECLIPSE+CDT will appear above three errors, I also appeared during the initial installation. According to my article, the first two errors will be solved in a step-by-step way.
The third phenomenon is because the CDT version number does not match the Eclipse version number, and the appropriate CDT version number is replaced. The problem will be solved.
JNI--eclipse Configuring the C/D + + development environment