Posted on 2018-11-28 15:06
Prayer 阅读(256)
评论(0) 编辑 收藏 引用 所属分类:
LINUX/UNIX/AIX
https://www.ibm.com/support/knowledgecenter/SSGH2K_12.1.0/com.ibm.xlc121.aix.doc/proguide/compiling_shared_aix.html
For use with runtime linking
To create a shared library that uses runtime linking: 创建一个动态库,可以运行时连接
- Follow steps 1 and 2 in the procedure described above.
- Use the -G option to create a shared library from the generated object files, and to enable runtime linking with applications that support it.
- If you created an export file, use the -bE linker option to use your global symbol export list. If you do not specify a -bE option, all symbols are exported.
For example:xlc -G -o libtest.so test1.o test2.o -bE:exportlist
- Link the shared library to the main application using the -brtl option, as described in Linking a library to an application.
Dynamic loading of a shared library
Shared libraries built for either dynamic or runtime linking can be dynamically loaded.
动态连接或运行时链接 See the AIX documentation for more information about using the dynamic loading routines: