I am getting the following error in Step 1 while building glog:
[ 17%] Performing build step for 'glog'
[ 4%] Building CXX object CMakeFiles/glog.dir/src/demangle.cc.o
[ 9%] Building CXX object CMakeFiles/glog.dir/src/logging.cc.o
[ 13%] Building CXX object CMakeFiles/glog.dir/src/raw_logging.cc.o
[ 18%] Building CXX object CMakeFiles/glog.dir/src/utilities.cc.o
[ 22%] Building CXX object CMakeFiles/glog.dir/src/symbolize.cc.o
[ 27%] Building CXX object CMakeFiles/glog.dir/src/vlog_is_on.cc.o
[ 31%] Building CXX object CMakeFiles/glog.dir/src/signalhandler.cc.o
[ 36%] Linking CXX shared library libglog.so
[ 36%] Built target glog
[ 40%] Building CXX object CMakeFiles/stl_logging_unittest.dir/src/stl_logging_unittest.cc.o
[ 45%] Building CXX object CMakeFiles/logging_unittest.dir/src/logging_unittest.cc.o
[ 50%] Building CXX object CMakeFiles/symbolize_unittest.dir/src/symbolize_unittest.cc.o
[ 54%] Building CXX object CMakeFiles/demangle_unittest.dir/src/demangle_unittest.cc.o
[ 59%] Building CXX object CMakeFiles/stacktrace_unittest.dir/src/stacktrace_unittest.cc.o
[ 63%] Building CXX object CMakeFiles/utilities_unittest.dir/src/utilities_unittest.cc.o
[ 68%] Linking CXX executable stacktrace_unittest
[ 68%] Built target stacktrace_unittest
[ 72%] Building CXX object CMakeFiles/signalhandler_unittest.dir/src/signalhandler_unittest.cc.o
[ 77%] Linking CXX executable signalhandler_unittest
[ 77%] Built target signalhandler_unittest
[ 81%] Linking CXX executable utilities_unittest
[ 86%] Linking CXX executable symbolize_unittest
[ 90%] Linking CXX executable demangle_unittest
/usr/bin/ld: CMakeFiles/utilities_unittest.dir/src/utilities_unittest.cc.o:(.data.rel.ro._ZTI41utilities_InitGoogleLoggingDeathTest_Test[_ZTI41utilities_InitGoogleLoggingDeathTest_Test]+0x10): undefined reference to `typeinfo for testing::Test'
/usr/bin/ld: CMakeFiles/utilities_unittest.dir/src/utilities_unittest.cc.o:(.data.rel.ro._ZTI40utilities_sync_val_compare_and_swap_Test[_ZTI40utilities_sync_val_compare_and_swap_Test]+0x10): undefined reference to `typeinfo for testing::Test'
collect2: error: ld returned 1 exit status
make[8]: *** [CMakeFiles/utilities_unittest.dir/build.make:100: utilities_unittest] Error 1
make[7]: *** [CMakeFiles/Makefile2:1009: CMakeFiles/utilities_unittest.dir/all] Error 2
make[7]: *** Waiting for unfinished jobs....
/usr/bin/ld: CMakeFiles/symbolize_unittest.dir/src/symbolize_unittest.cc.o:(.data.rel.ro._ZTI38Symbolize_SymbolizeWithDemangling_Test[_ZTI38Symbolize_SymbolizeWithDemangling_Test]+0x10): undefined reference to `typeinfo for testing::Test'
/usr/bin/ld: CMakeFiles/symbolize_unittest.dir/src/symbolize_unittest.cc.o:(.data.rel.ro._ZTI24Symbolize_Symbolize_Test[_ZTI24Symbolize_Symbolize_Test]+0x10): undefined reference to `typeinfo for testing::Test'
collect2: error: ld returned 1 exit status
make[8]: *** [CMakeFiles/symbolize_unittest.dir/build.make:100: symbolize_unittest] Error 1
make[7]: *** [CMakeFiles/Makefile2:931: CMakeFiles/symbolize_unittest.dir/all] Error 2
/usr/bin/ld: CMakeFiles/demangle_unittest.dir/src/demangle_unittest.cc.o:(.data.rel.ro._ZTI22Demangle_FromFile_Test[_ZTI22Demangle_FromFile_Test]+0x10): undefined reference to `typeinfo for testing::Test'
/usr/bin/ld: CMakeFiles/demangle_unittest.dir/src/demangle_unittest.cc.o:(.data.rel.ro._ZTI20Demangle_Clones_Test[_ZTI20Demangle_Clones_Test]+0x10): undefined reference to `typeinfo for testing::Test'
/usr/bin/ld: CMakeFiles/demangle_unittest.dir/src/demangle_unittest.cc.o:(.data.rel.ro._ZTI25Demangle_CornerCases_Test[_ZTI25Demangle_CornerCases_Test]+0x10): undefined reference to `typeinfo for testing::Test'
collect2: error: ld returned 1 exit status
make[8]: *** [CMakeFiles/demangle_unittest.dir/build.make:100: demangle_unittest] Error 1
make[7]: *** [CMakeFiles/Makefile2:957: CMakeFiles/demangle_unittest.dir/all] Error 2
[ 95%] Linking CXX executable stl_logging_unittest
[ 95%] Built target stl_logging_unittest
[100%] Linking CXX executable logging_unittest
/usr/bin/ld: CMakeFiles/logging_unittest.dir/src/logging_unittest.cc.o:(.data.rel.ro._ZTI29UserDefinedClass_logging_Test[_ZTI29UserDefinedClass_logging_Test]+0x10): undefined reference to `typeinfo for testing::Test'
/usr/bin/ld: CMakeFiles/logging_unittest.dir/src/logging_unittest.cc.o:(.data.rel.ro._ZTI21Strerror_logging_Test[_ZTI21Strerror_logging_Test]+0x10): undefined reference to `typeinfo for testing::Test'
/usr/bin/ld: CMakeFiles/logging_unittest.dir/src/logging_unittest.cc.o:(.data.rel.ro._ZTI24SafeFNMatch_logging_Test[_ZTI24SafeFNMatch_logging_Test]+0x10): undefined reference to `typeinfo for testing::Test'
/usr/bin/ld: CMakeFiles/logging_unittest.dir/src/logging_unittest.cc.o:(.data.rel.ro._ZTI24DeathCheckNN_Simple_Test[_ZTI24DeathCheckNN_Simple_Test]+0x10): undefined reference to `typeinfo for testing::Test'
/usr/bin/ld: CMakeFiles/logging_unittest.dir/src/logging_unittest.cc.o:(.data.rel.ro._ZTI24CheckNOTNULL_Simple_Test[_ZTI24CheckNOTNULL_Simple_Test]+0x10): undefined reference to `typeinfo for testing::Test'
/usr/bin/ld: CMakeFiles/logging_unittest.dir/src/logging_unittest.cc.o:(.data.rel.ro._ZTI23DeathSTREQ_logging_Test[_ZTI23DeathSTREQ_logging_Test]+0x10): more undefined references to `typeinfo for testing::Test' follow
collect2: error: ld returned 1 exit status
make[8]: *** [CMakeFiles/logging_unittest.dir/build.make:100: logging_unittest] Error 1
make[7]: *** [CMakeFiles/Makefile2:879: CMakeFiles/logging_unittest.dir/all] Error 2
make[6]: *** [Makefile:166: all] Error 2
make[5]: *** [CMakeFiles/glog.dir/build.make:86: glog/src/glog-stamp/glog-build] Error 2
make[4]: *** [CMakeFiles/Makefile2:154: CMakeFiles/glog.dir/all] Error 2
make[3]: *** [Makefile:136: all] Error 2
make[2]: *** [CMakeFiles/MappingResearchKEU_superbuild.dir/build.make:86: MappingResearchKEU_superbuild/src/MappingResearchKEU_superbuild-stamp/MappingResearchKEU_superbuild-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/MappingResearchKEU_superbuild.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
I thought it might be because of the glog version, but it still does not work with v0.6.0.
I am using Ubuntu 20.04 and GCC 9.4.0. I also tried updating to GCC 11, but it still did not work.
I am getting the following error in Step 1 while building glog:
I thought it might be because of the glog version, but it still does not work with v0.6.0. I am using Ubuntu 20.04 and GCC 9.4.0. I also tried updating to GCC 11, but it still did not work.