我有一段代碼,使用升壓轉換器的unordered_set升壓/ unordered_set:編譯MinGW的錯誤()
#include <boost/unordered_set.hpp>
boost::unordered_set<string> mySet(100);
它編譯和正常工作與UNIX下的gcc。當我嘗試用交叉編譯的mingw32(GMAKE 3.8.1)我得到以下信息:
In file included
from /usr/i686-pc-mingw32/sys-root/mingw/include/boost/functional/hash/detail/hash_float.hpp:17,
from /usr/i686-pc-mingw32/sys-root/mingw/include/boost/functional/hash/hash.hpp:15,
from /usr/i686-pc-mingw32/sys-root/mingw/include/boost/functional/hash.hpp:6,
from /usr/i686-pc-mingw32/sys-root/mingw/include/boost/unordered/unordered_set.hpp:17,
from /usr/i686-pc-mingw32/sys-root/mingw/include/boost/unordered_set.hpp:16,
from /mnt/VirtualBoxShare/percolator/src/ProteinProbEstimatorHelper.h:33,
from /mnt/VirtualBoxShare/percolator/src/ProteinProbEstimator.cpp:28:
/usr/i686-pc-mingw32/sys-root/mingw/include/boost/cstdint.hpp:105: error: expected unqualified-id before 'unsigned'
/usr/i686-pc-mingw32/sys-root/mingw/include/boost/cstdint.hpp:105: error: expected ';' before 'unsigned'
/usr/i686-pc-mingw32/sys-root/mingw/include/boost/cstdint.hpp:105: error: declaration does not declare anything
/usr/i686-pc-mingw32/sys-root/mingw/include/boost/cstdint.hpp:114: error: expected unqualified-id before 'unsigned'
/usr/i686-pc-mingw32/sys-root/mingw/include/boost/cstdint.hpp:114: error: expected ';' before 'unsigned'
/usr/i686-pc-mingw32/sys-root/mingw/include/boost/cstdint.hpp:114: error: declaration does not declare anything
對我來說,這似乎是一個與模板有關的問題;有什麼建議麼?
謝謝 馬蒂亞
[編輯]
其他升壓功能是可用的,例如詞彙投
#include <boost/lexical_cast.hpp>
MinGW和gcc的哪個版本?也許你可以使用C++ 0x unordered_set來代替這個來自boost的? – Zuljin 2011-06-15 15:02:45
什麼版本的Boost?你有'#包括'?和'使用std :: string;'或'使用namespace std;'? –
ildjarn
2011-06-15 18:56:21
@Zuljin對不起,mingw32-boost-1.41.0和mingw32-gcc-C++ - 4.4.2。包含字符串標題,我使用std :: string。 – 2011-06-16 12:01:22