• <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, 評(píng)論 - 12, 引用 - 0
            數(shù)據(jù)加載中……

            boost庫(kù)生成文件命名和編譯

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

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

               這些定義為:

              BOOST_LIB_PREFIX: 靜態(tài)庫(kù)為 "lib" (否則無,是用動(dòng)態(tài)鏈接庫(kù))

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

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

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

              BOOST_LIB_RT_OPT: 指示使用的運(yùn)行庫(kù)的后綴, 

               組合下面的一個(gè)或者更多字符:

               s 靜態(tài)運(yùn)行庫(kù),指的是靜態(tài)鏈接到運(yùn)行時(shí)庫(kù)(不出現(xiàn)表示動(dòng)態(tài)).

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

               d 調(diào)試版本 (不出現(xiàn)表示 release 版 ).

               p STLPort 版本.

               注:對(duì) vc 來說,gd 總是一起出現(xiàn)

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

            1:運(yùn)行boost下的bootstap.bat腳本就會(huì)自動(dòng)生上述的兩個(gè)編譯工具,并且拷貝到boost目錄下. 也可以進(jìn)入tools/build目錄下找到類似的腳本或者項(xiàng)目源碼來編譯.

            2: bjam.exe的參數(shù)

            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>

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

            --stagedir=<stagedir>

            存放編譯后庫(kù)文件的路徑,默認(rèn)是stage

            --build-type=complete

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

            variant=debug|release

            決定編譯什么版本(對(duì)應(yīng)文件中的d 調(diào)試版本 不出現(xiàn)表示 release 版)

            link=static|shared

            決定使用靜態(tài)庫(kù)還是動(dòng)態(tài)庫(kù)。(對(duì)應(yīng)文件中的BOOST_LIB_PREFIX )

            threading=single|multi

            決定使用單線程還是多線程庫(kù)。(對(duì)應(yīng)文件中的BOOST_LIB_THREAD_OPT)

            runtime-link=static|shared

            決定是靜態(tài)還是動(dòng)態(tài)鏈接C/C++標(biāo)準(zhǔn)庫(kù)。(對(duì)應(yīng)文件中的BOOST_LIB_THREAD_OPT)

            --with-<library>

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

            --show-libraries

            顯示需要編譯的庫(kù)名稱

             

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

            bjam.exe --toolset=msvc-10.0 --with-date_time runtimelink=shared link=static stage
            意思是要生靜態(tài)庫(kù),該靜態(tài)庫(kù)動(dòng)態(tài)鏈接C運(yùn)行時(shí)庫(kù)
            生成的文件名字是:libboost_date_time-vc100-mt-gd-1_48.lib(debug verion),libboost_date_time-vc100-mt-1_48.lib(release version) 兩個(gè)文件.

            bjam.exe --toolset=msvc-10.0 --with-date_time runtimelink=shared link=shared stage
            意思是要生動(dòng)態(tài)庫(kù),該動(dòng)態(tài)庫(kù)動(dòng)態(tài)鏈接C運(yùn)行時(shí)庫(kù)
            生成的文件名字是:boost_date_time-vc100-mt-gd-1_48.lib(debug version),boost_date_time-vc100-mt-1_48.lib(release version) 兩個(gè)文件.
            生成的dll名字是:boost_date_time-vc100-mt-gd-1_48.dll(debug version),boost_date_time-vc100-mt-1_48.dll(release version)

            編譯選項(xiàng)方面還有install等參數(shù).





             

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


            只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            久久久久人妻精品一区二区三区| 久久最新精品国产| 久久精品国产亚洲7777| 久久久久久久久无码精品亚洲日韩 | 久久丫精品国产亚洲av不卡 | 国内精品久久久久| 久久精品国产网红主播| 久久精品亚洲一区二区三区浴池| 久久九九兔免费精品6| 2021国产精品午夜久久| 午夜精品久久久久久影视riav| 欧美伊人久久大香线蕉综合69 | 久久久久女教师免费一区| 大香网伊人久久综合网2020| 国产AV影片久久久久久| 久久国产成人午夜aⅴ影院| 久久精品国产99国产精品| 一本大道久久香蕉成人网| 精品人妻伦九区久久AAA片69| 亚洲国产另类久久久精品黑人| 久久久无码一区二区三区| 国产亚洲婷婷香蕉久久精品| 999久久久国产精品| 亚洲伊人久久综合影院| 思思久久99热只有频精品66| 亚洲va国产va天堂va久久| 九九99精品久久久久久| 久久久久久A亚洲欧洲AV冫 | 国内精品综合久久久40p| 久久久久免费看成人影片| 91精品国产91久久| 久久精品国产亚洲AV影院 | 亚洲国产精品久久久久婷婷老年| 久久国产高清一区二区三区| 亚洲va久久久噜噜噜久久男同| 国产精久久一区二区三区| 久久亚洲AV无码精品色午夜麻豆| 大伊人青草狠狠久久| 2020久久精品亚洲热综合一本| 精品免费tv久久久久久久| 久久免费看黄a级毛片|