The Eclipse CDT configures the C + + compilation Environment

Source: Internet
Author: User
Tags documentation pack java web wxwidgets

Reproduced in Http://blog.csdn.net/goodfunman/archive/2005/08/31/468319.aspx when Visual C + + Long tail, when the Borland C + + Builder bloated, when the wallet empty, Isn't there a C + + IDE that we can afford and are good enough for in Windows?
Of course not. There is another thing in the world called Open source.
The purpose of this article is to show you how to build the C + + IDE under Windows XP with open source software (although it's better to go with Linux OS), there's no question that Windows OS is at least as easy to use as Linux OS, not to mention in China, There are far more users of Windows than Linux users.
When Visual C + + has a tail, and when Borland C + + Builder is bloated and empty, there is no more than the C + + IDE that we can afford and are good enough for in Windows.
Of course not. There is another thing in the world called Open source.
The purpose of this article is to show you how to build the C + + IDE under Windows XP with open source software (although it's better to go with Linux OS), there's no question that Windows OS is at least as easy to use as Linux OS, not to mention in China, There are far more users of Windows than Linux users.

1. Installation of Java JDK
The development platform for C + + Why install Java JDK. This seems to be the sad point of C + +. The reason is simple, because the eclipse we are using is not only the IDE for Java development, but also based on Java Virtual machine development. And because of that, Eclipse has a good portability, and what you need is not a particular operating system, but just a Java JDK. So while this article is written for Windows OS, a lot of content can be applied to other OS.
Installing the Java SDK is simple. Find the Java JDK Installer for your operating system on the http://java.sun.com, download it and run it, and the Java SDK will be installed on your system. I downloaded the latest Java JDK 1.5. Note that newer versions of Eclipse require a later version of the Java JDK, and the current eclipse uses the Java JDK above 1.4.2.
For more help with Java JDK installation, refer to the online documentation on the Java Web site.
(Note: Eclipse requires Java JDK to run, not just JRE, because Eclipse itself integrates Java development functionality and requires support from the Java JDK.) )

2. Eclipse and CDT installation
Go to Eclipse's official website http://www.eclipse.org to download eclipse. Eclipse has several versions to download, including the latest 3.1, 3.0.1, 2.1.2, and so on. 3.1 of them are newer versions, but unfortunately there is no Chinese patch pack. But this is no big obstacle for the brothers. If you really want to use a Chinese development environment, download 3.0.1, and the latest language patch packs support 3.0.1. As for 2.1.2, if you have ever used eclipse, and you prefer the previous interface style, then 2.1.2 will be more suitable for you.
In fact, different versions of Eclipse can coexist peacefully. Just install them in a different directory (I'm using 3.0.1 and 3.1 at the same time).
OK, let's say we're going to download the 3.0.1 version of Eclipse. First select the appropriate mirror Web site, and then download the Eclipse 3.0.1 packages and the 3.0.1_translations language patches separately to extract them into the same directory. Don't rush to run now. Oh, there's still a lot of things to do.
Now you need to install the CDT. The full name of the CDT is the C + + Development Tools, which are plug-ins that enable eclipse to support C + + development. Go to the CDT's official website, HTTP://WWW/ECLIPSE.ORG/CDT, and then select a mirrored site to download the CDT 2.0.2 and the CDT's Language patch pack (if you choose 2.x version of Eclipse, download the 1.x CDT). When the download is complete, unzip the two compressed packets into the eclipse's directory.
Now that the installation is complete, click on Eclipse's beautiful icon to see how it works.
(You can also install the CDT with Eclipse's software update feature after you install Eclipse, and refer to the Eclipse's online documentation for a specific step.) )

3. Installation MinGW
Now the C + + IDE is still not moving because of the lack of important parts. This component is a C + + compiler. Under Windows OS we can select two compilers, Cygwin and MinGW respectively. The former is supported by Redhat, but now is not completely open source, need to spend some fees to purchase licenses, specific content can refer to http://www.redhat.com/software/cygwin/. This obviously does not satisfy us, a Windows XP is already expensive enough. So we choose MinGW.
Now go to MinGW's website http://mingw.sourceforge.net, download Mingw-3.1.0-1.exe, then run EXE file installation. To make it easier to use later, create a batch file:

Mingw32setvar.bat
SET PATH = d:/mingw/bin;%path%
SET Library_path = D:/mingw/lib
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

Again, to run the CDT, create a batch file:

Cdt.bat
Set path=%path%;D:/mingw/bin
Set Library_path=d:/mingw/lib
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

D:/eclipse/eclipse.exe

Now let's test it. Click Cdt.bat to open Eclipse and click the new-> project-> the managed make C + + project. Create a new main.cpp in your project, enter a simple program, and run it. See the results. If you have any questions, you can search the Eclipse CDT on Google and find a lot of relevant articles that will help you.

4. Installation wxwidgets
What Wxwidgets is. I'm sure you've heard of Wxwindows. This year, under the pressure of MS, the Wxwindows development team had to change its name to Wxwidgets, but it was as good as it used to be.
The inevitable development of Windows is the content of GUI design. It is too outdated to use only the MinGW Win32API interface. Wxwidgets is undoubtedly a good choice.
On the wxwidgets website http://wxWindows.sourceforge.net, download 2.4.2 or version 2.5.3 wxwidgets, and then unzip, note that the uncompressed path cannot contain whitespace characters. Then, refer to Docs/msw/install.txt to compile the library that is needed for the build.
(Note: You may need to install more MinGW tools to complete wxwidgets compilation, which are also available on Wxwidgets's web site.) )
Now, open Eclipse, create a new standard make C + + project, and add an example from the wxwidgets. Then, in the project options, set the Builder command to: Make-f makefile.g95, and then save. Build the project and run it. The form you are expecting appears.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.