I would like to get shared libs for dynamic linking.
I have object files and static files, but no shared lib files.
Can I convert somehow them to create shared lib?
See http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html .
Basically, you create a shared library like this:
gcc -shared -Wl,-soname,libfoo.so.1 -o libfoo.so.1.0.1 file1.o file2.o file3.o ...
The generated file will be named libfoo.so.1.0.1
. However, you have to make sure that the *.o
files were created with the -fPIC
flag for position independent code or it won't work.
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.