"Linus" configuration gcc, g++, and GDB

Source: Internet
Author: User

Using GCC from Linux to compile C programs, using g++ to compile C + + programs, using GDB to debug programs, which need to be installed on their own, how should you configure these tools?

1. View the VIM information and see if there are any. vimrc and. Viminfo Profiles

650) this.width=650; "title=" 11.png "alt=" wkiol1dkqjqxsp5baabgl6zwdfq375.png-wh_50 "src=" http://s3.51cto.com/ Wyfs02/m00/82/12/wkiol1dkqjqxsp5baabgl6zwdfq375.png-wh_500x0-wm_3-wmp_4-s_490697614.png "/>

2. Configure GCC, g++

Use Yum in CentOS to configure GCC and g++.

To install GCC, on the command line enter: yum-y install GCC, press ENTER to be able to perform GCC installation, to install g++, you need to enter on the command line: yum-y install gcc++, you can do g++ installation.

Note: The following may occur if you enter the above instructions

650) this.width=650; "title=" 11.png "alt=" wkiol1dkqplxxnu_aaawy7jtm5i008.png-wh_50 "src=" http://s5.51cto.com/ Wyfs02/m01/82/12/wkiol1dkqplxxnu_aaawy7jtm5i008.png-wh_500x0-wm_3-wmp_4-s_4159368852.png "/>

Therefore, you need to root, enter Su, and then enter the password. Enter the password, the password is not visible, and then enter the above instructions can be used for GCC and g++ installation, as shown, appears complete! Indicates that the installation was successful.

650) this.width=650; "title=" 11.png "alt=" wkiom1dkqu6jzaagaaa33-sydee767.png-wh_50 "src=" http://s2.51cto.com/ Wyfs02/m00/82/13/wkiom1dkqu6jzaagaaa33-sydee767.png-wh_500x0-wm_3-wmp_4-s_3166487854.png "/>

But found in the installation of g++, prompted that there is no relevant g++ package. That's a different order. Yum Install gcc-c++ then enter y to download the g++ installation package, or enter the Yum install gcc-c++ directly. (The virtual machine must have a network, the specific settings can be found online)

650) this.width=650; "title=" 11.png "alt=" wkiol1dkrw7bxqboaaar5aevtgq281.png-wh_50 "src=" http://s1.51cto.com/ Wyfs02/m00/82/12/wkiol1dkrw7bxqboaaar5aevtgq281.png-wh_500x0-wm_3-wmp_4-s_2942991359.png "/>

3. Configuring GDB

(1) in the Linux system, open the Web page http://ftp.gnu.org/gnu/gdb/ , the following interface will appear:

650) this.width=650; "title=" 11.png "src=" http://s4.51cto.com/wyfs02/M00/82/12/ Wkiol1dkumkwxr34aaaogmc2pus796.png-wh_500x0-wm_3-wmp_4-s_3998649573.png "alt=" Wkiol1dkumkwxr34aaaogmc2pus796.png-wh_50 "/>

Here are some of the GDB tool's compressed packages, and then we select one of the versions to download, here I choose the gdb-7.11 version. After downloading, use the LS command to view the downloaded file as follows:

650) this.width=650; "title=" 11.png "src=" http://s1.51cto.com/wyfs02/M00/82/12/ Wkiol1dkuoptrvgmaaaldv4q8dw815.png-wh_500x0-wm_3-wmp_4-s_1725582043.png "alt=" Wkiol1dkuoptrvgmaaaldv4q8dw815.png-wh_50 "/>

(2) After downloading, the compressed file must be decompressed, in the command Window input: Tar xzvf gdb-7.11.tar.gz, after extracting, can see a file gdb-7.11:

650) this.width=650; "title=" 11.png "src=" http://s3.51cto.com/wyfs02/M01/82/12/wKioL1dKu9qjtvRuAAAz7T5Dd_0859. Png-wh_500x0-wm_3-wmp_4-s_2123932892.png "alt=" Wkiol1dku9qjtvruaaaz7t5dd_0859.png-wh_50 "/>

(3) Enter the extracted directory: CD gdb-7.10, enter command:./configure, use Dir to view after completion

650) this.width=650; "title=" 11.png "src=" http://s3.51cto.com/wyfs02/M02/82/13/ Wkiom1dku92hfsqpaaavktep6zu687.png-wh_500x0-wm_3-wmp_4-s_969807940.png "alt=" Wkiom1dku92hfsqpaaavktep6zu687.png-wh_50 "/>

(4) Input command: make, compile gdb

650) this.width=650; "title=" 11.png "src=" http://s3.51cto.com/wyfs02/M00/82/12/ Wkiol1dkvubyucz3aaaahr6z1em317.png-wh_500x0-wm_3-wmp_4-s_3455031310.png "alt=" Wkiol1dkvubyucz3aaaahr6z1em317.png-wh_50 "/>

(5) Then use: Make install, install GDB

650) this.width=650; "title=" 11.png "src=" Http://s1.51cto.com/wyfs02/M02/82/12/wKioL1dKvl_ Rvf-6aaaqvcg0epg693.png-wh_500x0-wm_3-wmp_4-s_2572700409.png "alt=" wkiol1dkvl_rvf-6aaaqvcg0epg693.png-wh_50 "/ >

(6) Use: gdb-v, view GDB version information to confirm the installation is correct

650) this.width=650; "title=" 11.png "src=" http://s4.51cto.com/wyfs02/M00/82/13/ Wkiom1dkvfuh-pwqaaa4yiogpck126.png-wh_500x0-wm_3-wmp_4-s_3845908710.png "alt=" Wkiom1dkvfuh-pwqaaa4yiogpck126.png-wh_50 "/>

This article is from the "Scen" blog, make sure to keep this source http://10741357.blog.51cto.com/10731357/1784252

"Linus" configuration gcc, g++, and GDB

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.