• <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>

            牽著老婆滿街逛

            嚴以律己,寬以待人. 三思而后行.
            GMail/GTalk: yanglinbo#google.com;
            MSN/Email: tx7do#yahoo.com.cn;
            QQ: 3 0 3 3 9 6 9 2 0 .

            [C++]VS2005(VC8) 使用 Boost

            轉自:http://chuiwenchiu.spaces.live.com/blog/cns!CA5D9227DF9E78E8!922.entry


            最新版本:http://docs.google.com/View?docid=dcxw59mr_979d22p4p
             
            測試環境:
            [1] Widnows XP Professional
            [2] Visual Studio 2005 Team Studio(VC8.0)
            [3] WinCvs 1.3

            1. 下載 Boost
            •   透過 CVS 下載最新版
                cvs -d:pserver:anonymous@boost.cvs.sourceforge.net:/cvsroot/boost login
              [詢問密碼時,直接輸入 Enter 略過]
              cvs -z3 -d:pserver:anonymous@boost.cvs.sourceforge.net:/cvsroot/boost checkout boost
              cvs -d:pserver:anonymous@boost.cvs.sourceforge.net:/cvsroot/boost logout


            2. 組態設定
            • 執行 C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat

            3. 建置與安裝(* [boost] 表示 boost 的根目錄)
            •   執行 [boost]\tools\jam\build_dist.bat
            •   將 [boost]\tools\jam\src\boost-jam-3.1.14-1-ntx86\bjam.exe 複製到 [boost]\bjam.exe
            •   切換到 [boost]\ 執行 bjam "-sTOOLS=vc-8_0" install
            •   漫長的等待~~~~~~~~ 相關 header 與 lib 產生在 C:\Boost
            •  修改 C:\Boost\include\boost-1_35\boost\config\suffix.hpp 內容
              #  define BOOST_LIB_TOOLSET "vc80"
              成如下
              #  define BOOST_LIB_TOOLSET "vc"
              (或是將 c:\Boost\Lib\ 下的所有 *.lib 的 -vc- 取代為 -vc80- (如:bgl-viz-vc.lib -> bgl-viz-vc80.lib, boost_date_time-vc-1_35.dll -> boost_date_time-vc80-1_35.dll)否則程式在連結時會發生找不到 lib 的錯誤)
            • 將 C:\Boost\include\boost-1_35 加入 VC2005 的 Include 路徑
              • Tools | Options | Projects and Solutions | VC++ Directories
              • Show directories for: Include files
            • 將 C:\Boost\lib 加入 VC2005 的 Lib 路徑
              • Tools | Options | Projects and Solutions | VC++ Directories
              • Show directories for: Library files

            4. 測試

            // 正規表示法測試:信用卡號檢測
            #include <boost/regex.hpp>
            #include 
            <iostream>

            bool validate_card_format(const std::string s)
            {
                    
            static const boost::regex e("(\\d{4}[- ]){3}\\d{4}");
                    
            return regex_match(s, e);
            }

            int _tmain(int argc, _TCHAR* argv[])
            {
                std::cout 
            << (validate_card_format("1111-1111-1111-2222")?"PASS":"Error") ; // PASS

                
            return 0;
            }

            // 計算兩個日期相差的天數
            #include <iostream>
            #include 
            <boost/date_time/gregorian/gregorian.hpp>

            using namespace std;
            using namespace boost::gregorian;

            int _tmain(int argc, _TCHAR* argv[]){
                date_duration dd 
            = date(200011- date(190011);
                cout 
            << "The twentieth century had " << dd.days() << " days" << endl; // 36524

                dd 
            = date(210011- date(200011);
                cout 
            << "The twenty-first century will have " << dd.days() << " days" << endl; // 36525   
             
                
            return 0;
            }


            參考資料:
            [1] http://www.boost.org/more/getting_started.html
            [2] http://www.programmer-club.com/pc2020v5/forum/ShowSameTitleN.asp?URL=N&board_pc2020=c&index=8&id=33560&mode=quarter&type_pc2020=sametitleLevel-2


            posted on 2007-11-09 00:30 楊粼波 閱讀(949) 評論(0)  編輯 收藏 引用

            狠狠色丁香久久婷婷综合五月| 精品久久久久久无码免费| 一本色道久久综合| 精品伊人久久久| 欧美黑人又粗又大久久久| 久久免费精品视频| 久久国产影院| 久久亚洲美女精品国产精品| 伊人丁香狠狠色综合久久| 久久毛片一区二区| 国产精品丝袜久久久久久不卡| 久久无码中文字幕东京热| 91精品日韩人妻无码久久不卡| 久久人人爽人人爽人人片AV不 | 亚洲成色999久久网站| 久久久WWW成人| 久久久久久午夜成人影院 | 人人狠狠综合久久88成人| 伊人久久免费视频| 婷婷伊人久久大香线蕉AV| 国产成人久久久精品二区三区| 香蕉久久av一区二区三区| 久久涩综合| 日本精品久久久中文字幕| 丁香色欲久久久久久综合网| 久久中文精品无码中文字幕| 久久美女网站免费| 国产精品视频久久久| 人妻无码久久一区二区三区免费| 久久亚洲精品无码观看不卡| 国产AⅤ精品一区二区三区久久| 97久久超碰国产精品2021| 久久久免费精品re6| 国产亚洲精久久久久久无码77777| 久久久精品波多野结衣| 精品久久国产一区二区三区香蕉| 99久久成人国产精品免费| 国产Av激情久久无码天堂| 久久99精品久久只有精品| 国产欧美一区二区久久| 国内精品久久久久久99|