C++アプリケーションでhash_mapを使用しています。バージョン4.1.2でアプリケーションをビルドすると成功しました。私はバージョンでアプリケーションを構築しようとすると、それは私が/usr/include/c++/4.4.6/backward/backward_warning.h
を見て、unordered_map
にhash_map
を変更の提案に基づいてC++ 4.4.6にhash_mapを含めるには?
/include/c++/4.4.6/backward/backward_warning.h:28:2: error: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
としてエラーを投げている4.4.6。
は今、私は/usr/include/c++/4.4.6/c++0x_warning.h
にのみエラーメッセージを見ることができ、
/include/c++/4.4.6/c++0x_warning.h:31:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
を、次のエラーを取得しています。
私はC++をかなり新しくしています。誰かが私にこれを手伝ってもらえますか?
"hash_map"の変更をunordered_mapに元に戻してから、コンパイル構造の最後に "-Wno-deprecated"(引用符は不要)を追加してください。 4.4.6で廃止予定のパッケージがあるようです –
-std = C++ 0xまたは-std = gnu ++ 0xコンパイラオプションでC++ 0xサポートを有効にできますか? (C++ 0xは2011年に標準化されて以来C++ 11と呼ばれています)。または、-Wno-deprecatedを指定して最初の警告を無効にすることもできます。または、5年より新しいコンパイラ・バージョンを使用することもできます。 – immibis
C++ 11を有効にする必要がある 'std :: unordered_map'を使う代わりに' std :: tr1 :: unordered_map'( '#include')を使うことができます –
Praetorian