• <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:
            久久99精品久久久久久| 久久99国产精品久久| 久久久久国产成人精品亚洲午夜| 亚洲国产精品无码久久九九| 亚洲中文久久精品无码| 久久99国产精品久久99果冻传媒| 久久乐国产精品亚洲综合| 久久国产色AV免费观看| 婷婷伊人久久大香线蕉AV| 国产精品99久久久精品无码| 精品久久久久久综合日本| 国内精品久久久久久麻豆| 精品久久久久久无码中文野结衣| 精品国产福利久久久| 欧美久久亚洲精品| 亚洲欧洲日产国码无码久久99| 人人狠狠综合久久亚洲88| 麻豆成人久久精品二区三区免费| 久久精品国产一区二区| 97精品伊人久久久大香线蕉| 亚洲精品白浆高清久久久久久| 四虎影视久久久免费观看| 亚洲一本综合久久| 欧美一区二区精品久久| 久久精品草草草| 国内精品久久久久影院日本| 一本久久a久久精品亚洲| 久久婷婷色香五月综合激情| 久久国产福利免费| 日本免费久久久久久久网站| 99久久久精品| 久久精品草草草| 99久久www免费人成精品| 99久久国产热无码精品免费久久久久| 中文无码久久精品| 国产亚洲色婷婷久久99精品| 久久AV高清无码| 久久99精品国产99久久6| 色婷婷综合久久久久中文字幕 | 97精品伊人久久大香线蕉app| 久久99精品国产麻豆宅宅|