私はそれをコンパイルし、UNIXでgccでうまく動作しブーストのunordered_setブースト/ unordered_set:mingwのでコンパイルエラー()
#include <boost/unordered_set.hpp>
boost::unordered_set<string> mySet(100);
を使用するコードの部分を持っています。私は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
Boostのどのバージョンですか?あなたは '#include'を持っていますか?そして 'std :: string;を使うか、' using namespace std; '? –
ildjarn
@Zuljin申し訳ありません、mingw32-boost-1.41.0とmingw32-gcc-C++ - 4.4.2。文字列ヘッダがインクルードされ、std :: stringを使用しています。 –