Introduction to C/C ++

Source: Internet
Author: User

I think the most important thing to learn a language well is practice. That is, more "writes "! "Accumulation of engineering Experience" is very important for programmers who have been developing for a period of time! Only through continuous accumulation can we gradually understand the things behind C/C ++.

It has been 5 or 6 years since the last C ++ program was written and tuned. It has been a tough time and many things have to be picked up again. There are many C/C ++ ides in Windows, and I know MS Visual Studio and Borland C ++, but these are copyrighted. I don't need to pay for it, but because I am too familiar with Eclipse, I chose Eclipse + GNU toolchain (the word toolchain is very good ).

1. First download Eclipse for C ++. The latest version is based on Eclipse 3.5.1, called galileo.) I can't stand this strange name. Why isn't it Bruno? In the previous version 3.4, it seems to be called ganymede guard ).

2. decompress the package and run it directly. Note: At least JDK has been installed and I use JDK 1.6 ). After running, a gray-blue welcome page appears, entering Tutorials. Reading Tutorial is a good habit.

3. first understand what CDT is, C/C ++ Development Toolkit, bulabula... then it said that this item does not contain the C/C ++ compiler and debugger. You have to do it yourself.

4. Continue. In Windows, MinGW and Cygwin are two main methods for obtaining the GNU toolchain: GNU toolchain, a series of tool kits under GNU, my understanding is mainly the gcc tool series ).

The biggest difference between the two is that MinGW uses the Windows C Runtime Library, called mscvrt, while Cygwin uses a GPL-based DLLsGPL protocol that is contagious, after you use the software under the GPL protocol, you must also follow the GPL Protocol). Therefore, MinGW avoids the GPL protocol.

5. MinGW and CDT can be well integrated. Okay, the installation of MinGWMinGW is the meaning of Minimal GNU for Windows. The download process is quite slow. I spent more than half an hour ). When the cursor was mingw-5.1.6.exe, I came up with a Full install. After installation, we found that Do not install the MinGW Make feature as the MSYS version of make from step 5 is a more complete implementation of make. do not install Make of MinGW. MSYS in step 1 is a better implementation solution)

6. In order to avoid possible problems in the future, the reinstallation is uninstalled. Here is the complete installation steps:

Download MinGW, address http://sourceforge.net/projects/mingw/files/

2) install MinGW base tool and g ++ compiler instead of Make). I have installed all the files except Make, and there is actually a Ada compiler in it.

3) the current version of it refers to the MinGW-5.1.3, but I do not have 5.1.6 under the same) Not Installed gdb debugger, download it: http://downloads.sourceforge.net/mingw/gdb-6.6.tar.bz2

4)decompress gdb-6.6.tar.bz2 to the place where you install MinGW, gdb-6.6/also has a series of bin, inclue folder, copy directly to MinGW to overwrite it

5) If you want to use Makefile, download the MSYS-1.0.10.exe, MSYS is an implementation of make and command line. Well, use it. Http://downloads.sourceforge.net/mingw/MSYS-1.0.10.exe installation interface is a command interface, write 2 "y", and then inform MinGW installation path.
OK. The installation is complete. Below are two small examples.

7. First, create a simple HelloWorld C ++ project. This is very simple. Just create a template by following the Wizard. Select Run Configurations when running, and double-click C/C ++ application to create a new Run configuration.

8. Create a Makefile project. Select New C ++ Project-> Makefile project-> Empty Project, and create an Empty Project. After the project is created, there are no more than two projects. project file). At this time, we need to create a source file and a make file: main. cpp and makefile are created in the root directory as follows:

  1. How to Write C ++ project development and project plan correctly
  2. Summary Notes on learning and exploring C ++ library functions
  3. In-depth demonstration of high security of C ++
  4. Describes in detail how to accurately Write C ++ languages.
  5. In-depth demonstration of high security of C ++

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.