我正在尝试使用-fprofile-generate
标志对我的代码运行配置文件引导优化。当我用它编译时,我收到以下错误。
obj\Debug\main.o||In function ZNSt10_HashtableIiSt4pairIKiiESaIS2_ENSt8__detail10_Select1stESt8equal_toIiESt4hashIiENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb0ELb1EEEE5clearEv':|
c:\program files (x86)\gfortran\lib\gcc\mingw32\4.10.0\include\c++\bits\hashtable.h|1937|undefined reference to __gcov_indirect_call_profiler_v2'|
c:\program files (x86)\gfortran\lib\gcc\mingw32\4.10.0\include\c++\bits\hashtable.h|1937|undefined reference to __gcov_indirect_call_callee'|
c:\program files (x86)\gfortran\lib\gcc\mingw32\4.10.0\include\c++\bits\hashtable.h|1937|undefined reference to __gcov_time_profiler'|
c:\program files (x86)\gfortran\lib\gcc\mingw32\4.10.0\include\c++\bits\hashtable.h|1942|undefined reference to __gcov_one_value_profiler'|
c:\program files (x86)\gfortran\lib\gcc\mingw32\4.10.0\include\c++\bits\hashtable.h|1942|undefined reference to __gcov_average_profiler'|
c:\program files (x86)\gfortran\lib\gcc\mingw32\4.10.0\include\c++\bits\hashtable.h|1942|undefined reference to __gcov_ior_profiler'|
中还有其他错误消息,但所有这些都与__gcov
我无法在网上找到任何关于此的内容。有人可以帮忙吗?我在 Windows 上使用 g++ 8.1.0 并使用-march=native
,-std=c++14
和-ffast-math
标志。-fprofile-generate
该程序在没有标志的情况下完全符合并运行良好。