• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Prayer

            在一般中尋求卓越
            posts - 1256, comments - 190, trackbacks - 0, articles - 0
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            Compiling a shared library

            Posted on 2018-11-28 15:06 Prayer 閱讀(285) 評論(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 dynamic linking

            To compile a shared library that uses dynamic linking: 編譯一個動態庫,可以動態鏈接

            1. Compile each source file into an object file, with no linking. For example:
              xlc -c test1.c -o test1.oCopy
            2. Optional: Create an export file listing the global symbols to be exported, by doing one of the following:
              • Use the CreateExportList utility, described in Exporting symbols with the CreateExportList utility.
              • Use the -qexpfile compiler option with the -qmkshrobj option. The -qexpfile option saves all exported symbols from a list of given object files in a designated file. For example:
                xlc -qmkshrobj -qexpfile=exportlist test1.o test2.oCopy
              • Manually create an export file using a text editor. You can edit an export file to include or exclude global symbols from the target shared library.
            3. Use the -qmkshrobj option to create a shared library from the generated object files.
              • If you created an export file in step 2, 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 -qmkshrobj -o mySharedObject.o test1.o test2.o -bE:exportlistCopy
              Notes
              • The default name of the shared object is shr.o, unless you use the -o option to specify another name.
              • Exporting some functions (such as restf# where # is a number) might cause incorrect execution.
            4. Optional: Use the AIX® ar command to produce an archive library file from multiple shared or static objects. For example:
              ar -rv libtest.a mySharedObject.o myStaticObject.oCopy
            5. Link the shared library to the main application, as described in Linking a library to an application.
              這種做法,還是生成了.a文件呀。

            For use with runtime linking

            To create a shared library that uses runtime linking: 創建一個動態庫,可以運行時連接

            1. Follow steps 1 and 2 in the procedure described above.
            2. 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  Copy
            3. 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:
            中文字幕日本人妻久久久免费| 国产精品久久久久久一区二区三区| 亚洲国产精品久久久久| 久久国产精品免费一区二区三区| 精品国产青草久久久久福利| 香蕉久久久久久狠狠色| 久久久精品人妻一区二区三区蜜桃| 色综合久久综合网观看| 亚洲一级Av无码毛片久久精品| 久久久久久夜精品精品免费啦| 久久久久久av无码免费看大片 | 久久亚洲AV成人无码国产 | 国产一区二区久久久| 久久久无码一区二区三区| 久久久久99精品成人片| 日韩精品久久无码中文字幕| 久久久久九九精品影院| 国产精品久久久久影院嫩草| 中文字幕久久久久人妻| 久久天天躁狠狠躁夜夜不卡| 国产婷婷成人久久Av免费高清| 亚州日韩精品专区久久久| 国产99久久久国产精品~~牛| 亚洲精品国产美女久久久 | 久久人妻少妇嫩草AV无码专区| 色综合久久夜色精品国产| 国产精品无码久久久久| 久久青青草原国产精品免费| 人妻无码αv中文字幕久久 | 久久久久久精品免费免费自慰| 久久精品女人天堂AV麻| 狠狠综合久久综合中文88| 91精品国产91久久久久久| 久久久久一区二区三区| 久久精品9988| 精品久久久久久无码免费| 国産精品久久久久久久| 久久久久国产精品麻豆AR影院| 久久综合狠狠综合久久激情 | 国产V亚洲V天堂无码久久久| 久久久久亚洲AV片无码下载蜜桃|