I have a question: How to compile a static library in Linux with gcc, i.e. I need to compile my source code into a file named out.a. Is it sufficient to simply compile with the command gcc -o out.a out.c? I’m not quite familiar with gcc, hope anyone can give me a hand.
I have a question: How to compile a static library in Linux with gcc
Share
See Creating a shared and static library with the gnu compiler [gcc]
-cmeans to create an intermediary object file, rather than an executable.This creates the static library.
rmeans to insert with replacement,cmeans to create a new archive, andsmeans to write an index. As always, see the man page for more info.