Compiling C + + programs in Ubantu Linux environment

Source: Internet
Author: User

First create a new A.cpp file in the file, write the program in it, and then open the terminal to enter the following command;

$ g++ a.cpp-o b/S    compile the a.cpp and then save the compiled. exe file to B $./////////////               Execute the current directory B, which means to run the program;

This is a simple compile run, followed by debugging (personal advice directly with the output of the corresponding variable method is better), the following records some basic commands

$ g++ a.cpp-o b-g///$ gdb     ///$ file B  ///corresponding file b$ l       //View the contents of B, L (list), $ b 8///     Set breakpoints in line 8th, B (breakpoint); $ r       ///Run, R (Run (Ning)); $ c//       /Continue, C (countinue); $ d 1     //delete 1th breakpoint, d (delete); $ Q//       exit Debug, Q (Quit);

  

Compiling C + + programs in Ubantu Linux environment

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.