• <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++博客 :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

            Compiling a shared library

            Posted on 2018-11-28 15:06 Prayer 閱讀(288) 評(píng)論(0)  編輯 收藏 引用 所屬分類(lèi): 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: 編譯一個(gè)動(dòng)態(tài)庫(kù),可以動(dòng)態(tài)鏈接

            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: 創(chuàng)建一個(gè)動(dòng)態(tài)庫(kù),可以運(yùn)行時(shí)連接

            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.
            動(dòng)態(tài)連接或運(yùn)行時(shí)鏈接
            See the AIX documentation for more information about using the dynamic loading routines:
            人妻精品久久久久中文字幕69 | 欧美va久久久噜噜噜久久| 亚洲中文字幕无码久久精品1| 亚洲午夜久久久久久久久久 | 久久久久久国产精品无码下载 | 久久国产色AV免费观看| 久久国产美女免费观看精品| 久久水蜜桃亚洲av无码精品麻豆 | 亚洲精品无码久久不卡| 成人资源影音先锋久久资源网| 欧美久久久久久午夜精品| 精品永久久福利一区二区| 久久精品成人一区二区三区| 久久国产乱子伦免费精品| 久久精品国产99国产精品亚洲| 国产高潮久久免费观看| 狠狠色丁香婷综合久久| 久久偷看各类wc女厕嘘嘘| 久久笫一福利免费导航 | 久久婷婷五月综合国产尤物app | 国产69精品久久久久久人妻精品| 国产精品日韩深夜福利久久| 国产精品久久久久…| 久久午夜羞羞影院免费观看| 伊人久久大香线焦AV综合影院| 思思久久好好热精品国产| 香蕉99久久国产综合精品宅男自 | 人妻无码精品久久亚瑟影视| 精品一久久香蕉国产线看播放| 久久国产高清字幕中文| 久久人人爽人人爽人人片AV麻烦| 久久综合久久综合亚洲| 伊人色综合九久久天天蜜桃| 日本加勒比久久精品| 久久se精品一区精品二区国产| 久久精品国产亚洲Aⅴ蜜臀色欲| 久久免费美女视频| 国产精品嫩草影院久久| 久久天天躁狠狠躁夜夜2020老熟妇| 国产精品免费看久久久香蕉| 久久精品成人欧美大片|