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

            Design&Art

            C++博客 首頁 新隨筆 聯系 聚合 管理
              26 Posts :: 0 Stories :: 38 Comments :: 0 Trackbacks
            為了使用hash_map,今天下載了STLport,在VC6下編譯成功。

            1. STLport下載:http://www.stlport.org/
                  我下載的是最新版  02.25.07: STLport 5.1.2 released

            2. STLport編譯:
                  我的STLport目錄是:D:\STLport-5.1.2
                  先設置一下VC6下的環境變量:C:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT
                 把D:\STLport-5.1.2\stlport;加入Include路徑中;把D:\STLport-5.1.2\lib;加入Lib路徑中
                  在命令行窗口下:
                  運行VCVARS32.BAT,然后
                  cd D:\STLport-5.1.2\build\lib
                  configure -c msvc6
                  nmake /fmsvc.mak install
                  編譯全部用的默認選項,因此編譯出來的是多線程靜態鏈接庫。庫文件被拷貝到D:\STLport-5.1.2\lib

            3. 在VC6中使用STLport:
                  Tools->Options...->Directories中
                  include設置中添加目錄:D:\STLport-5.1.2\stlport
                  library設置中添加目錄:D:\STLport-5.1.2\lib
                  Project->Settings...->C/C++中
                  Category選擇Code Generation,然后在use run-time library中選擇Debug Multithreaded。(如果是release版本,選擇Multithreaded;如果想用動態鏈接,則要先編譯動態鏈接版本的STLport,再在這兒選擇相應的DLL)

            4. hash_map的例子:
            #include <iostream>
            #include 
            <hash_map>
            #include 
            <string>

            using namespace std;

            int main()
            {
                hash_map
            <intstring> mymap;
                mymap[
            2008]="VC6";
                mymap[
            999999]="STLport";
                mymap[
            123456]="hello hash_map!";
                hash_map
            <intstring>::iterator iter = mymap.find(123456);
                
            if(iter != mymap.end())
                
            {
                    cout
            <<iter->second<<endl;
                }

                
            return 0;
            }

            posted on 2007-04-16 14:22 安帛偉 閱讀(8403) 評論(21)  編輯 收藏 引用 所屬分類: STL

            Feedback

            # re: VC6下使用STLPort 2007-05-20 21:12 risefei
            若問:設置一下VC6下的環境變量:C:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT
            怎么設置?  回復  更多評論
              

            # re: VC6下使用STLPort 2007-05-20 23:24 abware
            @risefei
            用記事本打開VCVARS32.BAT
            查找set INCLUDE=和set LIB=
            把D:\STLport-5.1.2\stlport;加入Include路徑中;把D:\STLport-5.1.2\lib;加入Lib路徑中
            示例如下:
            set INCLUDE=D:\STLport-5.1.3\stlport;%MSVCDir%\ATL\INCLUDE;%MSVCDir%\INCLUDE;%MSVCDir%\MFC\INCLUDE;%INCLUDE%
            set LIB=D:\STLport-5.1.3\lib;%MSVCDir%\LIB;%MSVCDir%\MFC\LIB;%LIB%
              回復  更多評論
              

            # re: VC6下使用STLPort[未登錄] 2007-06-12 16:45 hh
            好象沒有你下的餓哪個版本只有STLport-4.6.2.tar.gz這個里面沒有lib文件夾 也沒有*.lib文件! xp下的cmd不能認識make nmake 命令啊!怎么辦?  回復  更多評論
              

            # re: VC6下使用STLPort[未登錄] 2007-06-12 22:11 hh
            我按照以上弄好了 不過編譯文件時 錯誤更多了!例如:
            error C2039: 'ostream' : is not a member of 'stlp_std'
            error C2061: syntax error : identifier 'ostream' 等等! 是什么問題 請指教!3Q  回復  更多評論
              

            # re: VC6下使用STLPort[未登錄] 2007-06-13 10:20 hh
            針對你上面寫的那個程序也有問題 LIKE是有9個錯誤 !是我那里沒有設置正確 ?
            其中的一個錯誤:unresolved external symbol "class stlpmtx_std::basic_ostream<char,class stlpmtx_std::char_traits<char> > stlpmtx_std::cout" (?cout@stlpmtx_std@@3V?$basic_ostream@DV?$char_traits@D@stlpmtx_std@@@1@A)  回復  更多評論
              

            # re: VC6下使用STLPort報這個錯誤是怎么回事啊 2007-06-22 15:37 lee
            LINK : fatal error LNK1104: cannot open file "stlport_static_stld50.lib"
            Error executing link.exe.  回復  更多評論
              

            # re: VC6下使用STLPort 2007-06-26 20:40 abware
            看看你編譯出來的庫文件在哪,該路徑是否加到了VC6的環境變量配置文件VCVARS32.BAT中
            @lee
              回復  更多評論
              

            # re: VC6下使用STLPort 2007-06-26 20:42 abware
            @hh
            你仔細按照步驟來,特別注意第3步里use run-time library中選擇的版本要和你編譯出來的版本一致。  回復  更多評論
              

            # re: VC6下使用STLPort 2008-01-09 13:10 wsfyc
            看了這篇文章,LINK問題終于解決了.按照步驟可定 成功。我的是STLPORT5-1-4  回復  更多評論
              

            # re: VC6下使用STLPort[未登錄] 2008-01-10 20:31 Eric
            @hh
            請問您這個問題是怎么解決的?,我也有這個問題@@

            謝謝:)  回復  更多評論
              

            # re: VC6下使用STLPort 2008-04-10 02:27 人渣
            好東西啊,謝謝您了  回復  更多評論
              

            # re: VC6下使用STLPort 2008-05-12 00:31 zyz
            @abware
            這個怎么提示 不是內部指令呢?  回復  更多評論
              

            # re: VC6下使用STLPort 2008-10-14 21:42 smallping
            我用的是錄制動畫程序Camstudio-2.0-src,按照上面的配置做好了,但編譯之后錯誤更多,如下:
            ompiling...
            FFont.cpp
            D:\Camstudio-2[1].0-src\vscap20s\Producer\swfsource\FFont.h(22) : error C2039: 'ostream' : is not a member of 'stlp_std'
            D:\Camstudio-2[1].0-src\vscap20s\Producer\swfsource\FFont.h(22) : error C2061: syntax error : identifier 'ostream'
            D:\Camstudio-2[1].0-src\vscap20s\Producer\swfsource\FFont.h(22) : error C2039: 'istream' : is not a member of 'stlp_std'
            D:\Camstudio-2[1].0-src\vscap20s\Producer\swfsource\FFont.h(22) : error C2061: syntax error : identifier 'istream'
            D:\Camstudio-2[1].0-src\vscap20s\Producer\swfsource\FFont.h(28) : error C2039: 'istream' : is not a member of 'stlp_std'
            D:\Camstudio-2[1].0-src\vscap20s\Producer\swfsource\FFont.h(28) : error C2143: syntax error : missing ';' before '&'
            D:\Camstudio-2[1].0-src\vscap20s\Producer\swfsource\FFont.h(28) : error C2433: 'istream' : 'friend' not permitted on data declarations
            D:\Camstudio-2[1].0-src\vscap20s\Producer\swfsource\FFont.h(28) : error C2501: 'istream' : missing storage-class or type specifiers

            不知是什么原因,怎么也搞不明白,急急急!!!
            那位好心的大哥知道請告訴我。
            郵箱:smallping_hit@yahoo.com.cn  回復  更多評論
              

            # re: VC6下使用STLPort 2008-10-29 17:56 guobosheng
            在執行 nmake /fmsvc.mak install 命令時出錯:'nmake' 不是內
            或批處理文件。

            這個問題怎么解決的?急!謝謝幫忙!  回復  更多評論
              

            # re: VC6下使用STLPort 2008-10-29 18:00 guobosheng
            @hh

            你是否也有 'nmake' 不是內部或外部命令,也不是可運行的程序或批處理文件。這個問題?你是怎么解決的?  回復  更多評論
              

            # re: VC6下使用STLPort 2008-10-30 10:07 guobosheng
            @guobosheng
            關于“'nmake' 不是內部或外部命令,也不是可運行的程序或批處理文件。”問題的解決辦法:

            在“我的電腦--屬性--高級--環境變量”中, 添加如下變量:
              INCLUDE
              D:\Program Files\Microsoft Visual Studio\VC98\Include
              LIB
              D:\Program Files\Microsoft Visual Studio\VC98\Lib
              X:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;X:\Program Files\Microsoft Visual Studio\VC98\Bin
              X表示安裝盤符,注意這里是兩個路徑,因為cl.exe要用到MSDev98\Bin目錄下的MSPDB60.DLL。
              如果已經存在這些變量,則把以上值分別加在對應的變量值的后面,注意在添加前用分號隔開。  回復  更多評論
              

            # re: VC6下使用STLPort 2008-10-30 10:27 guobosheng
            編譯STLPort后出現102個錯誤!~~誰能救救我?
            錯誤信息:

            --------------------Configuration: stl - Win32 Debug--------------------
            Compiling...
            stl.cpp
            c:\program files\microsoft visual studio\vc98\include\string(17) : error C2143: syntax error : missing ';' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(17) : error C2433: 'basic_string' : 'inline' not permitted on data declarations
            c:\program files\microsoft visual studio\vc98\include\string(17) : error C2501: 'basic_string' : missing storage-class or type specifiers
            c:\program files\microsoft visual studio\vc98\include\string(17) : error C2059: syntax error : ';'
            c:\program files\microsoft visual studio\vc98\include\string(17) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(24) : error C2143: syntax error : missing ';' before '{'
            c:\program files\microsoft visual studio\vc98\include\string(24) : error C2447: missing function header (old-style formal list?)
            c:\program files\microsoft visual studio\vc98\include\string(25) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(26) : error C2143: syntax error : missing ';' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(26) : error C2433: 'basic_string' : 'inline' not permitted on data declarations
            c:\program files\microsoft visual studio\vc98\include\string(26) : error C2501: 'basic_string' : missing storage-class or type specifiers
            c:\program files\microsoft visual studio\vc98\include\string(26) : error C2086: 'basic_string' : redefinition
            c:\program files\microsoft visual studio\vc98\include\string(26) : error C2059: syntax error : ';'
            c:\program files\microsoft visual studio\vc98\include\string(26) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(33) : error C2143: syntax error : missing ';' before '{'
            c:\program files\microsoft visual studio\vc98\include\string(33) : error C2447: missing function header (old-style formal list?)
            c:\program files\microsoft visual studio\vc98\include\string(34) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(35) : error C2143: syntax error : missing ';' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(35) : error C2433: 'basic_string' : 'inline' not permitted on data declarations
            c:\program files\microsoft visual studio\vc98\include\string(35) : error C2501: 'basic_string' : missing storage-class or type specifiers
            c:\program files\microsoft visual studio\vc98\include\string(35) : error C2086: 'basic_string' : redefinition
            c:\program files\microsoft visual studio\vc98\include\string(35) : error C2059: syntax error : ';'
            c:\program files\microsoft visual studio\vc98\include\string(35) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(41) : error C2143: syntax error : missing ';' before '{'
            c:\program files\microsoft visual studio\vc98\include\string(41) : error C2447: missing function header (old-style formal list?)
            c:\program files\microsoft visual studio\vc98\include\string(42) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(44) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(44) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(45) : error C2803: 'operator ==' must have at least one formal parameter of class type
            c:\program files\microsoft visual studio\vc98\include\string(46) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(47) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(47) : error C2059: syntax error : '<'
              回復  更多評論
              

            # re: VC6下使用STLPort 2008-10-30 10:28 guobosheng
            續:

            c:\program files\microsoft visual studio\vc98\include\string(49) : error C2803: 'operator ==' must have at least one formal parameter of class type
            c:\program files\microsoft visual studio\vc98\include\string(49) : error C2805: binary 'operator ==' has too few parameters
            c:\program files\microsoft visual studio\vc98\include\string(50) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(51) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(51) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(53) : error C2803: 'operator !=' must have at least one formal parameter of class type
            c:\program files\microsoft visual studio\vc98\include\string(53) : error C2805: binary 'operator !=' has too few parameters
            c:\program files\microsoft visual studio\vc98\include\string(54) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(56) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(56) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(57) : error C2803: 'operator !=' must have at least one formal parameter of class type
            c:\program files\microsoft visual studio\vc98\include\string(58) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(59) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(59) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(62) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(63) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(63) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(65) : error C2803: 'operator <' must have at least one formal parameter of class type
            c:\program files\microsoft visual studio\vc98\include\string(65) : error C2805: binary 'operator <' has too few parameters
            c:\program files\microsoft visual studio\vc98\include\string(66) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(68) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(68) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(69) : error C2803: 'operator <' must have at least one formal parameter of class type
            c:\program files\microsoft visual studio\vc98\include\string(70) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(71) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(71) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(74) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(75) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(75) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(77) : error C2803: 'operator >' must have at least one formal parameter of class type
            c:\program files\microsoft visual studio\vc98\include\string(77) : error C2805: binary 'operator >' has too few parameters
            c:\program files\microsoft visual studio\vc98\include\string(78) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(80) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(80) : error C2059: syntax error : '<'
              回復  更多評論
              

            # re: VC6下使用STLPort 2008-10-30 10:28 guobosheng
            續:

            c:\program files\microsoft visual studio\vc98\include\string(81) : error C2803: 'operator >' must have at least one formal parameter of class type
            c:\program files\microsoft visual studio\vc98\include\string(82) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(83) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(83) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(86) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(87) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(87) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(89) : error C2803: 'operator <=' must have at least one formal parameter of class type
            c:\program files\microsoft visual studio\vc98\include\string(89) : error C2805: binary 'operator <=' has too few parameters
            c:\program files\microsoft visual studio\vc98\include\string(90) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(92) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(92) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(93) : error C2803: 'operator <=' must have at least one formal parameter of class type
            c:\program files\microsoft visual studio\vc98\include\string(94) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(95) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(95) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(98) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(99) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(99) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(101) : error C2803: 'operator >=' must have at least one formal parameter of class type
            c:\program files\microsoft visual studio\vc98\include\string(101) : error C2805: binary 'operator >=' has too few parameters
            c:\program files\microsoft visual studio\vc98\include\string(102) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(104) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(104) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(105) : error C2803: 'operator >=' must have at least one formal parameter of class type
            c:\program files\microsoft visual studio\vc98\include\string(106) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(107) : error C2143: syntax error : missing ',' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(107) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(111) : error C2954: template definitions cannot nest
            c:\program files\microsoft visual studio\vc98\include\string(112) : error C2143: syntax error : missing ';' before '<'
            c:\program files\microsoft visual studio\vc98\include\string(112) : error C2433: 'basic_istream' : 'inline' not permitted on data declarations
            c:\program files\microsoft visual studio\vc98\include\string(112) : error C2501: 'basic_istream' : missing storage-class or type specifiers
            c:\program files\microsoft visual studio\vc98\include\string(112) : error C2059: syntax error : ';'
            c:\program files\microsoft visual studio\vc98\include\string(112) : error C2059: syntax error : '<'
            c:\program files\microsoft visual studio\vc98\include\string(147) : error C2143: syntax error : missing ';' before '{'
            c:\program files\microsoft visual studio\vc98\include\string(147) : fatal error C1003: error count exceeds 100; stopping compilation
            Error executing cl.exe.

            stl.obj - 102 error(s), 0 warning(s)



              回復  更多評論
              

            # re: VC6下使用STLPort 2008-10-30 10:43 guobosheng
            上面的問題解決了:

            在樓主的第三步中:
            3. 在VC6中使用STLport:
            Tools->Options...->Directories中
            include設置中添加目錄:D:\STLport-5.1.2\stlport
            library設置中添加目錄:D:\STLport-5.1.2\lib

            添加了上面兩個目錄后,需要把它們向上移,放在第一位。這樣就沒有問題了,至于為什么,我想可能是有的信息只有在上面兩個目錄下下才能找到吧,先找別的目錄可能會因為找不到而出錯。只是我的猜測,也不知道具體原因,請高手指點。  回復  更多評論
              

            # re: VC6下使用STLPort[未登錄] 2008-10-30 11:40 cc

            樓主,在編譯STLPort的過程中會報錯

            無法定位程序輸入點RtlIpv4StringToAddressW于動態庫ntdll.dll上

            不過我用的STLPort 5.1.5  回復  更多評論
              

            99久久精品免费| 99久久免费只有精品国产| 中文无码久久精品| 丰满少妇人妻久久久久久| 国产成人久久AV免费| 香蕉久久永久视频| 久久亚洲私人国产精品vA| 国产成人精品久久亚洲高清不卡 | 久久av免费天堂小草播放| 亚洲AV无码久久精品成人| 国产精品一区二区久久精品无码| 久久国产成人午夜AV影院| 麻豆亚洲AV永久无码精品久久| 狠狠人妻久久久久久综合蜜桃| 亚洲国产精品成人久久| 色婷婷久久综合中文久久一本| 国内精品久久久久影院一蜜桃| 久久99热这里只有精品66| 99久久婷婷国产一区二区| 久久精品人成免费| 久久精品国产亚洲AV香蕉| 久久精品国产第一区二区| 欧美激情精品久久久久| 久久久久亚洲AV无码永不| 久久精品国产欧美日韩99热| 久久精品国产色蜜蜜麻豆| 久久久久免费精品国产| 久久综合亚洲色HEZYO社区| 久久性生大片免费观看性| 99精品久久久久久久婷婷| 狠狠干狠狠久久| 国产精品一久久香蕉国产线看观看| 亚洲一区精品伊人久久伊人 | 区亚洲欧美一级久久精品亚洲精品成人网久久久久 | 99999久久久久久亚洲| 久久久精品人妻一区二区三区蜜桃| 九九久久精品无码专区| 91久久香蕉国产熟女线看| www亚洲欲色成人久久精品| 国产精品久久精品| 国产精品久久久天天影视香蕉|