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

            Compiling a shared library

            Posted on 2018-11-28 15:06 Prayer 閱讀(286) 評論(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: 編譯一個動態(tài)庫,可以動態(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)建一個動態(tài)庫,可以運行時連接

            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.
            動態(tài)連接或運行時鏈接
            See the AIX documentation for more information about using the dynamic loading routines:
            亚洲欧美精品伊人久久| 国产成人久久777777| 色欲综合久久躁天天躁| 国产99久久久国产精品小说| 日韩欧美亚洲综合久久| 亚洲国产精品一区二区久久hs| 久久久精品午夜免费不卡| 久久久久久久综合狠狠综合| 国产精品久久久久jk制服| 国产综合成人久久大片91| 日韩精品久久久肉伦网站| 思思久久99热免费精品6| 日韩久久久久久中文人妻 | 国产精品久久久99| 久久人人爽人人爽人人片AV东京热| 97超级碰碰碰碰久久久久| 日产精品久久久久久久| 国产巨作麻豆欧美亚洲综合久久| 午夜久久久久久禁播电影| 四虎亚洲国产成人久久精品| 九九99精品久久久久久| 国产精品视频久久久| AAA级久久久精品无码片| 久久经典免费视频| 久久久久国产一级毛片高清板 | 精品人妻久久久久久888| 久久亚洲国产精品五月天婷| 久久久无码一区二区三区| 国产色综合久久无码有码| 久久精品国产99国产精品导航| 国产午夜电影久久| 国产日产久久高清欧美一区| 一本色道久久99一综合| 久久精品久久久久观看99水蜜桃| 亚洲午夜精品久久久久久浪潮| 久久强奷乱码老熟女| 青青青国产精品国产精品久久久久 | 精品综合久久久久久97超人 | 亚洲成色999久久网站| 久久综合视频网站| 久久精品国产99久久久古代|