エラー:#errorこのファイルには、ISO C ++ 2011標準のコンパイラとライブラリのサポートが必要です。

エラー:#errorこのファイルには、ISO C ++ 2011標準のコンパイラとライブラリのサポートが必要です。

Ubuntu 20.04 LTSでは、プロファイルとプロファイルツール(TAU)を使用してC ++コードを実行するためにいくつかのクラスタを使用しています。私が実行するコマンドは次のとおりです。

tau_cxx.sh -I$FFTW3_INC wrappingScript.cpp spectralFunctions.cpp arithmeticFunctions.cpp -optLinking="-lfftw3 -lm -g" -o ../../Datasim/TauTest.out

ただし、これにより次のエラーが発生します。

Executing> /opt/apps/gcc/5.2.0/bin/g++ -I/opt/apps/gcc5_2/mvapich22_2/fftw/3.3.8/include wrappingScript.cpp spectralFunctions.cpp arithmeticFunctions.cpp -o ../../Datasim/TauTest.out
In file included from /arcapps/cascades-broadwell-slurm/opt/apps/gcc/5.2.0/include/c++/5.2.0/cstdint:35:0,
                 from arithmeticFunctions.cpp:8:
/arcapps/cascades-broadwell-slurm/opt/apps/gcc/5.2.0/include/c++/5.2.0/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
  ^

make: *** [all] Error 1

だから私は次のようにコンパイルしようとしています-std=c++11

tau_cxx.sh -I$FFTW3_INC -std=c++11 wrappingScript.cpp spectralFunctions.cpp arithmeticFunctions.cpp -optLinking="-lfftw3 -lm -g" -o ../../Datasim/TauTest.out

これはどういうわけか私を台無しにし、-I$FFTW3_INC 次のエラーが発生します。

undefined reference to `fftw_malloc'

また、次のTAUオプションに接続してみました。

tau_cxx.sh -I$FFTW3_INC wrappingScript.cpp spectralFunctions.cpp arithmeticFunctions.cpp -optLinking="-lfftw3 -lm -std=c++11 -g" -o ../../Datasim/TauTest.out

これは効果がなく、元のエラーが発生します。誰でも助けることができますか?

ベストアンサー1

(必須)-std=c++11フラグを追加した後(異常に現在のデフォルト値(ISO C ++ 2017 + GNU拡張など)には古いフラグを含める必要があります)、コンパイルできますが、定義(-std=gnu++17おそらく一部のライブラリでは)fftw_mallocは消えました。マニュアルページを確認すると、fftw_malloc正しいスペルを教えてくれます。で呼び出される場合は、行またはMakefile類似LIB =の行を確認してください。

おすすめ記事