How do Beginners use C ++ to write programs in Linux?
Source: Internet
Author: User
How do Beginners use C ++ to write programs in Linux-general Linux technology-Linux programming and kernel information? For details, see below. Dear friends, my previous C ++ programs are all written in windows, but now I want to write a program in Linux, and I don't know where to start, compiling a simple program does not know how to use commands. debugging when the program is wrong is even more difficult! I hope you will introduce the entry-level knowledge in this area.
Sudo apt-get install g ++
Then you can use any editor you like to edit the source file.
Assume that your source file is a. c.
Then you
G ++-o a. c
Compiled successfully. There will be a file named a in this directory.
Run it later
./
You can use gdb to debug the program. In fact, there are still a lot of related information.
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