Many friends are using eclipse to do Java or Android development, let us see how to use Eclipse to build A/C + + development environment.
There are three things we want to prepare:
First, the Java Runtime Environment (Java Runtime Environment);
The second, needless to say, is eclipse for C + +;
Third, we need to use the GCC compiler (GNU Compiler gcc 4.9.1).
Java Runtime Environment (Java Runtime Environment) and Eclipse for C + + downloads believe that often with Eclipse Java development Friends will, here will not be wordy Ah!
It's important! Introduce the installation of GCC, I tried a few (too stupid) to find this method.
We go to equation solution website to download the GCC we need. URL link is http://www.equation.com/servlet/equation.cmd?fa=home
Browse Navigation Tree at the top left
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/4D/A4/wKioL1RV_qbBF8iRAACEVB0VO9k911.jpg "title=" Navigation Tree. png "alt=" wkiol1rv_qbbf8iraacevb0vo9k911.jpg "/>
Navigate to home-->progrramming Tools-->gnu Compliance
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4D/A4/wKiom1RV_ljBej1fAACe2PLytZE343.jpg "title=" GNU Compliance.png "alt=" Wkiom1rv_ljbej1faace2plytze343.jpg "/>
Choose to download the appropriate GCC (just use 4.9.1 bar)
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4D/A5/wKiom1RWB9HRT6BgAACYnz3K7B4347.jpg "title=" 4.9.1. PNG "alt=" wkiom1rwb9hrt6bgaacynz3k7b4347.jpg "/>
Here we have prepared two files:
One is eclipse for C + + and the other is gcc4.9.1.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/4D/A5/wKiom1RWCGCihtaEAAArXQpq7Jk054.jpg "title=" Two.png "alt=" Wkiom1rwcgcihtaeaaarxqpq7jk054.jpg "/>
Next Install GCC
Double-click Gcc-4.9.1-32.exe for self-extracting installation
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/4D/A4/wKioL1RWCWmj1m8jAABACTicftM016.jpg "title=" Jieya.png "alt=" Wkiol1rwcwmj1m8jaabacticftm016.jpg "/>
Of course Choose accept
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/4D/A4/wKioL1RWCf6T9ODLAADvHhlJy6w372.jpg "title=" Accept.png "alt=" Wkiol1rwcf6t9odlaadvhhljy6w372.jpg "/>
It is worth mentioning that the installation path here must be explained behind the C:\MinGW reason.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/4D/A4/wKioL1RWCcyhQ3phAAB1aHqxD_0830.jpg "title=" Mingw.png "alt=" Wkiol1rwccyhq3phaab1ahqxd_0830.jpg "/>
Finish.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/4D/A5/wKiom1RWCs-gh4kBAABVxR_8oh0817.jpg "title=" Finish.png "alt=" Wkiom1rwcs-gh4kbaabvxr_8oh0817.jpg "/>
On the command line, type gcc-v to see if GCC is installed successfully
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4D/A5/wKiom1RWC1ejQp2HAAEzO_PSFFY268.jpg "title=" gcc- V.png "alt=" Wkiom1rwc1ejqp2haaezo_psffy268.jpg "/>
You can see that there's a MinGW folder in the C-drive.
Unzip Eclipse-cpp-luna-sr1-win32.zip and double-click Eclipse.exe to open Eclipse for C + +
To create a new C project, be careful not to tick "Show project types and toolchains only if they is supported on the platform" in Toolchains: Select in the box below MinGW GCC.
The whole effect is as follows:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/4D/A5/wKiom1RWDUTyyqXBAAGdDVfpPCI233.jpg "title=" Eclipse.png "alt=" Wkiom1rwdutyyqxbaagddvfppci233.jpg "/>
You can see that the new C project contains the library file
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/4D/A4/wKioL1RWDgfg-YhQAACfbvqxZOw886.jpg "title=" Include.png "alt=" Wkiol1rwdgfg-yhqaacfbvqxzow886.jpg "/>
Create a new C file with:new-->source file
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/4D/A4/wKioL1RWDs7j-fDLAADOsu0Wntw642.jpg "title=" new C.png "alt=" Wkiol1rwds7j-fdlaadosu0wntw642.jpg "/>
Write a short Hello World program in TEST.c, and build a good project as follows:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4D/A4/wKioL1RWD2WjETlgAAFgdric7H8386.jpg "title=" Hello Word.png "alt=" Wkiol1rwd2wjetlgaafgdric7h8386.jpg "/>
Compiling:project-->build Project
After compiling the pass, will be more out of the debug directory, such as
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/4D/A5/wKiom1RWEBTzrFV7AAFjVRlDF2M201.jpg "title=" Build.png "alt=" Wkiom1rwebtzrfv7aafjvrldf2m201.jpg "/>
When compiling, the information that the console prints out
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/4D/A5/wKiom1RWEIKA8VwaAAGIOKDKHf4302.jpg "title=" Buildconsole.png "alt=" Wkiom1rweika8vwaaagiokdkhf4302.jpg "/>
Run:run-->run
The results of the console print out
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/4D/A4/wKioL1RWEUXj_01HAABajb0o8PA021.jpg "title=" Runconsole.png "alt=" Wkiol1rweuxj_01haabajb0o8pa021.jpg "/>
Next, explain why the installation directory must be C:\MinGW when installing GCC.
To view the help documentation in eclipse:
Help-->help Contents
Navigate to the section ( Note the red box mark!) )
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/4D/A4/wKioL1RWEf2zqW8_AAptxn0MF7Q034.jpg "title=" Help.png "alt=" Wkiol1rwef2zqw8_aaptxn0mf7q034.jpg "/>
The results are at a glance!
This article is from the "Extra blogs" blog, so be sure to keep this source http://duoyu.blog.51cto.com/4844967/1570960
Using Eclipse to build a C/D + + development environment in Win7