Reading Notes 2: several commands related to GCC Programming

Source: Internet
Author: User
Reading Note 2: several commands related to GCC programming-general Linux technology-Linux programming and kernel information. The following is a detailed description. The command for compiling the static library file is ar cr *. a *. o *. o.
Explanation: *. a is the target static library file to be compiled, and *. o is the compiled file.
View the function commands contained in the static library file: ar t/path/*.
Explanation:/path/is the path, and *. a is the static library file you want to view.
The first method for compiling dynamic library files: Step 1 to get *. o file, the command is: gcc-c *. c. The second step gets the dynamic library file. The command is gcc-shared *. o-o *. so (*. c. source code file of the dynamic library file you wrote. The suffix of the dynamic library file is. so)
The second method for compiling a dynamic library file: The command is gcc-fpic-shared *. c-o *. so (the explanation is as follows)
Several programming-related shell commands require some understanding, because they are helpful for programming:
Which is a command for finding the location of a file. It is very useful, because if you want to find a file, you only need to enter the file you want to search for after it, it will be found in a short period of time and display the path of the file to be queried.
File is a command to understand program attributes. You can directly enter the name of the execution program after it. It will tell you the attributes of the program.
The time command is used to understand the execution time of the program. The usage method is as follows. It tells you the execution time of the Input Program. This is mainly for some understanding after program optimization.
Nm
The methods of the two ld commands are the same as those above, and they are directly entered into the name of the execution program. Its role is to be considered by friends who want to learn programming and view the results.

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.