g++ -Wl,-Bsymbolic-functions -rdynamic -L/usr/lib/mysql -lmysqlclient -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX -I/usr/include/ -I/usr/include/c++/4.5/bits/ main.c -o program
を使用してUbuntuの
#include <unordered_map.h>
typedef unsigned int key_type; // fine, has < , ==, and std::hash
typedef std::map<key_type, some_value_type> my_map;
に次のコードをコンパイルしようとしている
と私はここで
[email protected](none:/usr/local/src/testing$ make
g++ -Wl,-Bsymbolic-functions -rdynamic -L/usr/lib/mysql -lmysqlclient -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX -I/usr/include/ -I/usr/include/c++/4.5/bits/ main.c -o program
In file included from main.c:5:0:
/usr/include/c++/4.5/bits/unordered_map.h:33:32: error: expected constructor, destructor, or type conversion before ‘(’ token
make: *** [all] Error 1
があり、このエラーを取得しますmap.hの検索
1234 @(なし):/ usr $ /ローカル/ SRC /テスト見つけmap.h
/usr/include/c++/4.5/bits/stl_map.h
/usr/include/c++/4.5/bits/stl_multimap.h
/usr/include/c++/4.5/bits/unordered_map.h
/usr/include/c++/4.5/debug/map.h
/usr/include/c++/4.5/debug/multimap。 h
/usr/include/c++/4.5/profile/map.h
/usr/include/c++/4.5/profile/multimap.h
/usr/include/c++/4.5/profile/impl/profiler_map_to_unordered_map.h
/usr/include/c++/4.5 /tr1/unordered_map.h
また、私はmysqlのために他のスタッドを持っていますが、私はこれを使用しますが、mainはちょうど0を返しています。
'map'または' unordered_map'を使用しますか? – robert
なぜunordered_mapをインクルードしますか?マップのタイプを宣言していますか? –