Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经生成了一个精灵共享库。我想在精灵标题中标记一个版本(如 1.2.2)。我可以使用 gcc 的链接器标志吗?如果没有,还有其他方法可以标记版本吗?
您可以检查是否有ld适合您需要的选项,然后使用 GCC option 传递它-Wl。
ld
-Wl
对于共享对象,您可以使用-Wl,-soname,libmyname.so.1.2.3.
-Wl,-soname,libmyname.so.1.2.3