making gcc prefer static libs to shared objects when linking?

后端 未结 3 1028
逝去的感伤
逝去的感伤 2020-12-30 23:52

When linking against libraries using the -l option (say -lfoo), gcc will prefer a shared object to a static library if both are found (will prefer

3条回答
  •  长情又很酷
    2020-12-31 00:24

    You can specify the full path to the static libs without the -l flag to link with those.

    gcc ... source.c ... /usr/lib32/libmysuperlib.a ...
    

提交回复
热议问题