stlPort+boost的編譯方法

來源:互聯網
上載者:User

這兩個庫,如果單獨使用的話,都還好應付,如果放在一起使用,就比較麻煩,有些需要注意的點。

 

stlport:

stlport目錄是主include目錄,在vc項目包含檔案夾設定中一定要把它提前(放在vs內建的前面)。
lib目錄在vs項目庫目錄中包含
bin目錄裡的dll,請放在執行檔案夾下,或乾脆放在windows的system目錄下,當然在環境變數PATH中添加路徑也可以。

目錄:
stlport    --    主要inlcude檔案夾,只需包含這個即可

src              - 非純模板庫的實現 source for iostreams implementation and other parts that aren't pure template code

lib              - installation directory for STLport library (if you use STLport iostreams and/or locale only);it may contain more subdirs, if you use crosscompilation)

iostram等非純模板程式碼程式庫的編譯:
To use STLport iostreams, locale and complex numbers, you have to build STLport library from sources in "build/lib" directory and link your programs with it.
從5.0版本開始,要使用stlPort,只能是使用stlPort提供的iostream或者乾脆沒有iostream。

具體參照:install

 

 

boost:

 

boost 其實同stlPort大致相同,基本上也是主要都是純模板代碼,但涉及到一些跟本地環境相關的,則需要特別編譯這些庫,例如:
    * Boost.Filesystem
    * Boost.IOStreams
    * Boost.ProgramOptions
    * Boost.Python (see the Boost.Python build documentation before building and installing it)
    * Boost.Regex
    * Boost.Serialization
    * Boost.Signals
    * Boost.System
    * Boost.Thread
    * Boost.Wave

編譯方法:(由於使用了stlPort,編譯格外麻煩!網上都是扯的,或者以前的版本,經過2個多小時無數次實驗,最終成功)
1.修改user-config.jam,加一句
using stlport : 5.2.1 : E://svn//ff//3party//STLport-5.2.1//stlport : E://svn//ff//3party//STLport-5.2.1//lib ;
注意:inlude和lib之間的冒號,具體位置具體設定。
2.在vs命令列裡,運行bootstrap.bat.
3.運行bjam stdlib=stlport --build-type=complete stage
--build-type=complete:build各種程式設定(mtd,mdd)下的boost版本。
stage:    代表編譯輸出目錄
4. 最後,別忘了把boost目錄加到vs的include檔案夾中,把stage/lib加到包含庫目錄。

警告:
ps: 在使用boost時,由於其使用stlPort編譯,需要在c/c++設定命令列設定中加上"/D_STLP_DEBUG"!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.