• <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>
            隨筆 - 64, 文章 - 11, 評論 - 12, 引用 - 0
            數據加載中……

            boost庫生成文件命名和編譯

            生成文件命名規則:boost中有許多庫,有的庫需要編譯、而有的庫不需要編譯,只需包含頭文件就可以使用。編譯生成的文件名字普遍較長,同一個庫根據編譯鏈接選項不同,又可以生成多個不同名字的文件。生成的文件名字是很長,可是這樣帶的信息才多,也就容易識別出用途。其實生成文件的名字遵循一定的規則,有著固定的格式。識別這種格式,能幫助我們更高效地使用boost庫。生成文件名字格式如: 

               BOOST_LIB_PREFIX + BOOST_LIB_NAME + "-" + BOOST_LIB_TOOLSET + "-" + BOOST_LIB_THREAD_OPT + "-" + BOOST_LIB_RT_OPT + "-" + BOOST_LIB_VERSION  

               這些定義為:

              BOOST_LIB_PREFIX: 靜態庫為 "lib" (否則無,是用動態鏈接庫)

              BOOST_LIB_NAME: 庫的基本名稱 ( 比方說 boost_regex).

              BOOST_LIB_TOOLSET: 編譯工具集名稱 ( 比如:vc6, vc7, bcb5 )

              BOOST_LIB_THREAD_OPT: 多線程為 "-mt" ,否則為空

              BOOST_LIB_RT_OPT: 指示使用的運行庫的后綴, 

               組合下面的一個或者更多字符:

               s 靜態運行庫,指的是靜態鏈接到運行時庫(不出現表示動態).

               g 調試/診斷 runtime (release if not present).

               d 調試版本 (不出現表示 release 版 ).

               p STLPort 版本.

               注:對 vc 來說,gd 總是一起出現

              BOOST_LIB_VERSION: Boost 版本, Boost 版本 x.y 表示為 x_y形式.
             
             編譯:為了簡化boost庫的編譯,boost庫中帶了一個用來編譯的工具,名字是bjam.exe或者b2.exe.

            1:運行boost下的bootstap.bat腳本就會自動生上述的兩個編譯工具,并且拷貝到boost目錄下. 也可以進入tools/build目錄下找到類似的腳本或者項目源碼來編譯.

            2: bjam.exe的參數

            Feature

            Allowed values

            Notes

            variant

            debug,release

             

            link

            shared,static

            Determines if Boost.Build creates shared or static libraries

            threading

            single,multi

            Cause the produced binaries to be thread-safe. This requires proper support in the source code itself.

            address-model

            32,64

            Explicitly request either 32-bit or 64-bit code generation. This typically requires that your compiler is appropriately configured. Please refer to the section called “C++ Compilers” and your compiler documentation in case of problems.

            toolset

            (Depends on configuration)

            The C++ compiler to use. See the section called “C++ Compilers” for a detailed list.

            (Vs2008)msvc-8.0 (vs2010)msvc-10.0

            include

            (Arbitrary string)

            Additional include paths for C and C++ compilers.

            define

            (Arbitrary string)

            Additional macro definitions for C and C++ compilers. The string should be either SYMBOL or SYMBOL=VALUE

            cxxflags

            (Arbitrary string)

            Custom options to pass to the C++ compiler.

            cflags

            (Arbitrary string)

            Custom options to pass to the C compiler.

            linkflags

            (Arbitrary string)

            Custom options to pass to the C++ linker.

            runtime-link

            shared,static

            Determines if shared or static version of C and C++ runtimes should be used.

            --build-dir=<builddir>

            編譯的臨時文件會放在builddir里(這樣比較好管理,編譯完就可以把它刪除了)

            --stagedir=<stagedir>

            存放編譯后庫文件的路徑,默認是stage

            --build-type=complete

            編譯所有版本,不然只會編譯一小部分版本(確切地說是相當于:variant=release, threading=multi;link=shared|static;runtime-link=shared)

            variant=debug|release

            決定編譯什么版本(對應文件中的d 調試版本 不出現表示 release 版)

            link=static|shared

            決定使用靜態庫還是動態庫。(對應文件中的BOOST_LIB_PREFIX )

            threading=single|multi

            決定使用單線程還是多線程庫。(對應文件中的BOOST_LIB_THREAD_OPT)

            runtime-link=static|shared

            決定是靜態還是動態鏈接C/C++標準庫。(對應文件中的BOOST_LIB_THREAD_OPT)

            --with-<library>

            只編譯指定的庫,如輸入--with-regex就只編譯regex庫了。

            --show-libraries

            顯示需要編譯的庫名稱

             

            bjam.exe --toolset=msvc-10.0 --with-date_time runtimelink=static link=static stage 
            意思是要生靜態庫,該靜態庫靜態鏈接C運行時庫
            生成的文件名字是:libboost_date_time-vc100-mt-sgd-1_48.lib(debug version),libboost_date_time-vc100-mt-s-1_48.lib(release version) 兩個文件.

            bjam.exe --toolset=msvc-10.0 --with-date_time runtimelink=shared link=static stage
            意思是要生靜態庫,該靜態庫動態鏈接C運行時庫
            生成的文件名字是:libboost_date_time-vc100-mt-gd-1_48.lib(debug verion),libboost_date_time-vc100-mt-1_48.lib(release version) 兩個文件.

            bjam.exe --toolset=msvc-10.0 --with-date_time runtimelink=shared link=shared stage
            意思是要生動態庫,該動態庫動態鏈接C運行時庫
            生成的文件名字是:boost_date_time-vc100-mt-gd-1_48.lib(debug version),boost_date_time-vc100-mt-1_48.lib(release version) 兩個文件.
            生成的dll名字是:boost_date_time-vc100-mt-gd-1_48.dll(debug version),boost_date_time-vc100-mt-1_48.dll(release version)

            編譯選項方面還有install等參數.





             

            posted on 2013-01-06 16:57 Robertxiao 閱讀(10000) 評論(0)  編輯 收藏 引用 所屬分類: boost 庫

            91精品国产91久久久久久蜜臀| 亚洲午夜福利精品久久| 久久免费视频观看| 久久久噜噜噜久久中文字幕色伊伊| 91精品久久久久久无码| 亚洲AV伊人久久青青草原| 亚洲中文字幕无码久久2017| 久久精品一本到99热免费| 精品国产热久久久福利| 成人午夜精品无码区久久| 青青国产成人久久91网| 久久精品日日躁夜夜躁欧美| 久久精品国产福利国产秒| 国产精品乱码久久久久久软件| 久久综合久久自在自线精品自| 久久99亚洲综合精品首页| 精品无码久久久久久尤物| 亚洲欧美久久久久9999| 亚洲国产成人久久综合碰碰动漫3d| 久久精品一区二区三区AV| 久久夜色精品国产亚洲av| AV狠狠色丁香婷婷综合久久| 久久午夜无码鲁丝片午夜精品| 7777久久久国产精品消防器材| 青青草原1769久久免费播放| 久久精品国内一区二区三区| 99久久99久久| 久久精品亚洲欧美日韩久久| 天天爽天天狠久久久综合麻豆| 99精品伊人久久久大香线蕉 | 香蕉99久久国产综合精品宅男自| 久久精品亚洲男人的天堂| 久久精品国产精品青草| 亚洲欧美日韩久久精品| 久久精品一本到99热免费| 日本免费一区二区久久人人澡| 久久久精品人妻无码专区不卡 | 国产ww久久久久久久久久| 久久久久久精品久久久久| 久久久久国产日韩精品网站| 久久久久亚洲国产|