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.
如果我所拥有的库只是一个 *.a 静态库。有没有办法可以将它转换为 *.so 动态链接库?也许使用ld?
我正在使用 SUSE Linux。精灵平台。
此命令将尝试执行您想要的操作:
gcc -shared -Wl,--whole-archive library.a -o library.so
但是如果你的库不是用-fpic/编译的-fPIC,它可能不是,它不会工作(它可能看起来工作,但你没有得到共享库的任何好处)。
-fpic
-fPIC