I am trying to run profile guided optimization on my code with -fprofile-generate
flag. When I compile with it, I am getting the following error.
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'|
There are other error messages in the but all of them are related to __gcov
I am not able to find anything online regarding this. Can someone please help?I am using g++ 8.1.0 on windows and using -march=native
, -std=c++14
and -ffast-math
flags. The program complies and runs perfectly fine without -fprofile-generate
flag.