简体   繁体   中英

Is it possible to create a static library directly using 'gcc' command?

To create a static library, in general, we follow the 2-step method. First, we create object files for each source file using the ' gcc ' command. Second, We will bundle all the object files using the ' ar ' command.

I know 'gcc' and 'ar' are two separate components. But, I would like to get the confirmation on whether it is possible to create a static library in a single step using the 'gcc' command? If yes, Could anyone suggest how we can do that?

Note: This question is not related to how to create a static library. This question is purely to get confirmation. I referred gcc manual entry page but I couldn't find a way to do that.

Let me know your thoughts on this.

There is no way to create the archive library using gcc only.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM