這兩個庫,如果單獨使用的話,都還好應付,如果放在一起使用,就比較麻煩,有些需要注意的點。
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"!