Optimization and flags for making a static library with g++

前端 未结 5 1585
一整个雨季
一整个雨季 2021-01-30 01:53

I am just starting with g++ compiler on Linux and got some questions on the compiler flags. Here are they

Optimizations

I read about optimizatio

5条回答
  •  广开言路
    2021-01-30 02:14

    There are many optimizations that a compiler can perform, other than loop unrolling and inlining. Loop unrolling and inlining are specifically mentioned there since, although they make the code faster, they also make it larger.

    To make a static library, use 'g++ -c' to generate the .o files and 'ar' to archive them into a library.

提交回复
热议问题