Notes about linux C

Source: Internet
Author: User

1. If you use a VM to install ubuntu, the host needs to enable services starting with the VM, and then use NAT and network connection modes, and set DHCP to automatically assign IP addresses to connect to the network.

2. To use Putty for remote connection, you need to enable the SSH service. openssh-server must be installed in the ipvtun system. Command: sudo apt-get install openssh

3. Putty connection Chinese garbled, the solution is to connect the encoding method for the UTF-8, and select a Chinese font. For example,

4. Enable the root account, and The sudo passwd continuously enters the password several times.

5. to edit the C program using GVIM, install GVIM with the command: sudo apt-get install gvim.

6. Use the c source program of math. h to compile with GCC, and add the parameter-lm.

7. gcc-help, man gcc

Gcc-p-g test. c is the file test. c. Create an profiling profile and add the debugging information to the executable file gcc-pg test. c only creates the profiling information gcc test for the gprof command. c generate. out file gcc-o count conut. c specifies the executable file named count for compilation.-c this command only compiles the source code into the target code and skips the Assembly and connection steps.-S this command stops compilation after the Assembly file is generated, the default extension is. s-E indicates that the compiler only preprocess the input file, and the pre-processing output is sent to the standard output instead of stored in the file-o-O2 to optimize the code. The former performs faster, the latter code gets smaller and the compilation speed is slower, but the execution efficiency is faster-g tells GCC to generate debugging information that can be used by the GNU Debugger to debug your program 8. run the gdb program: gdb-h file to load the debugging program. Kill it to terminate the program List that is being debugged. List A part of the code and run the Next Generation Code. If you do not enter the function, run the Next Generation Code Step, run the function to execute the program being debugged, run the command to stop gdb watch monitoring the value of a variable at Watch Quit. No matter when the value of the watch Mastering Print expression Break is changed, the program break 26 Make will not exit the gdb program, you can re-compile generate executable file Shell don't exit gdb program, you can execute UNIX shell attached finishing ppt learning information http://files.cnblogs.com/masky5310/Linux_Command.ppt

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.