For details about how to create a static library with GCC-general Linux technology-Linux programming and kernel, refer to the following. [I = s] This post was last edited by flamingwolf
I tried some tutorials.
Separate primary and subfunctions into files
The main function can be called to subfunctions, And the subfunctions can be run.
However, the sub-function value is not passed to the main function.
The compilation process is as follows:
Gcc-c d. c-o d. o
Ar rcs libd. a d. o
Gcc-c main. c-o main. o
Gcc main. o-L.-ld-o main
./Main
The result is as follows:
D is: 202.317684, C is: 609.335196, EC is: 0.332030
The result is: 0.000000 // (theoretically equal to 0.332030)
In addition, write the primary and subfunctions to the same file, compile and run
What should I do if I don't know how to change the static library?
Please help
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