using gtest and gmock at the same time with MinGW64 on Window10 gives linking error ? #3346
Replies: 2 comments 1 reply
-
I figure out the gmock "unreference" error, I forget add the gmock lib in my project CMakeLists.txt: change the following two line in my CMakeLists.txt find_library(NAMES gtest) into: find_library(NAMES gtest gmock) then linking passed, but there is still the "duplicate" warings: D:\ProgramFiles\msys2\mingw64\lib/libgtestd.a(gtest-all.cc.obj): duplicate section |
Beta Was this translation helpful? Give feedback.
-
From the information provided, we think this is unlikely to be an issue on our side. https://github.com/google/googletest/blob/master/docs/quickstart-cmake.md is our CMake quickstart tutorial. If you still believe this is a problem on our side, please provide us with more information. I'm going to convert this issue to a discussion so the community can help. |
Beta Was this translation helpful? Give feedback.
-
D:\ProgramFiles\msys2\mingw64\lib/libgtest.a(gtest-all.cc.obj): duplicate section
.rdata$_ZTVSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE[_ZTVSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE]' has different size D:\ProgramFiles\msys2\mingw64\lib/libgtest.a(gtest-all.cc.obj): duplicate section
.rdata$_ZTIN7testing8internal24DummyMatchResultListenerE[_ZTIN7testing8internal24DummyMatchResultListenerE]' has different sizeD:\ProgramFiles\msys2\mingw64\lib/libgtest.a(gtest-all.cc.obj): duplicate section
.rdata$_ZTSN7testing8internal24DummyMatchResultListenerE[_ZTSN7testing8internal24DummyMatchResultListenerE]' has different size D:\ProgramFiles\msys2\mingw64\lib/libgtest.a(gtest-all.cc.obj): duplicate section
.rdata$_ZTSN7testing25MatcherDescriberInterfaceE[_ZTSN7testing25MatcherDescriberInterfaceE]' has different sizeD:\ProgramFiles\msys2\mingw64\lib/libgtest.a(gtest-all.cc.obj): duplicate section
.rdata$_ZTISt13runtime_error[_ZTISt13runtime_error]' has different sizeD:\ProgramFiles\msys2\mingw64\lib/libgtest.a(gtest-all.cc.obj): duplicate section
.rdata$_ZTSSt13runtime_error[_ZTSSt13runtime_error]' has different sizeD:\ProgramFiles\msys2\mingw64\lib/libgtest.a(gtest-all.cc.obj): duplicate section.rdata$_ZTISt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE[_ZTISt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE]' has different size D:\ProgramFiles\msys2\mingw64\lib/libgtest.a(gtest-all.cc.obj): duplicate section
.rdata$_ZTSSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE[_ZTSSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE]' has different sizeD:\ProgramFiles\msys2\mingw64\lib/libgtest.a(gtest-all.cc.obj): duplicate section
.rdata$_ZTSSt9exception[_ZTSSt9exception]' has different size D:\ProgramFiles\msys2\mingw64\lib/libgtest.a(gtest-all.cc.obj): duplicate section
.rdata$_ZTSSt11_Mutex_baseILN9__gnu_cxx12_Lock_policyE2EE[_ZTSSt11_Mutex_baseILN9__gnu_cxx12_Lock_policyE2EE]' has different sizeD:\ProgramFiles\msys2\mingw64\bin\ld: D:\ProgramFiles\msys2\mingw64\bin\ld: DWARF error: could not find variable specification at offset eaaa
D:\ProgramFiles\msys2\mingw64\bin\ld: DWARF error: could not find variable specification at offset 11e8a
D:\ProgramFiles\msys2\mingw64\bin\ld: DWARF error: could not find variable specification at offset 11f2c
D:\ProgramFiles\msys2\mingw64\bin\ld: DWARF error: could not find variable specification at offset 14d5a
D:\ProgramFiles\msys2\mingw64\bin\ld: DWARF error: could not find variable specification at offset 14dff
D:\ProgramFiles\msys2\mingw64\bin\ld: DWARF error: could not find variable specification at offset 14ea4
D:\ProgramFiles\msys2\mingw64\bin\ld: DWARF error: could not find variable specification at offset 14f49
CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj):D:\Yesire-Lincoln\ProgramingHub\CandCpp\demoTryClang/gdemo_test.cpp:162: undefined reference to
testing::InitGoogleMock(int*, char**)' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
main':D:\Yesire-Lincoln\ProgramingHub\CandCpp\demoTryClang/gdemo_test.cpp:178: undefined reference to
testing::internal::GetWithoutMatchers()' D:\ProgramFiles\msys2\mingw64\bin\ld: D:\Yesire-Lincoln\ProgramingHub\CandCpp\demoTryClang/gdemo_test.cpp:184: undefined reference to
testing::internal::GetWithoutMatchers()'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
MockFoo::gmock_getArbitraryString[abi:cxx11]()': D:/Yesire-Lincoln/ProgramingHub/CandCpp/demoTryClang/inc/foo_interface.h:17: undefined reference to
testing::internal::UntypedFunctionMockerBase::RegisterOwner(void const*)'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::MockSpec<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > ()>::InternalExpectedAt(char const*, int, char const*, char const*)': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1278: undefined reference to
testing::internal::LogWithLocation(testing::internal::LogSeverity, char const*, int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::TypedExpectation<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > ()>::Times(int)': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:942: undefined reference to
testing::Exactly(int)'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::TypedExpectation<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > ()>::WillOnce(testing::Action<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > ()> const&)': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1012: undefined reference to
testing::Exactly(int)'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
MockFoo::getArbitraryString[abi:cxx11]()': D:/Yesire-Lincoln/ProgramingHub/CandCpp/demoTryClang/inc/foo_interface.h:17: undefined reference to
testing::internal::UntypedFunctionMockerBase::SetOwnerAndName(void const*, char const*)'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
MockFoo::gmock_getPosition()': D:/Yesire-Lincoln/ProgramingHub/CandCpp/demoTryClang/inc/foo_interface.h:18: undefined reference to
testing::internal::UntypedFunctionMockerBase::RegisterOwner(void const*)'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::MockSpec<int ()>::InternalExpectedAt(char const*, int, char const*, char const*)': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1278: undefined reference to
testing::internal::LogWithLocation(testing::internal::LogSeverity, char const*, int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::TypedExpectation<int ()>::Times(int)': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:942: undefined reference to
testing::Exactly(int)'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::TypedExpectation<int ()>::WillRepeatedly(testing::Action<int ()> const&)': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1033: undefined reference to
testing::AtLeast(int)'D:\ProgramFiles\msys2\mingw64\bin\ld: D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1038: undefined reference to
testing::internal::ExpectationBase::CheckActionCountIfNotDone() const' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
MockFoo::getPosition()':D:/Yesire-Lincoln/ProgramingHub/CandCpp/demoTryClang/inc/foo_interface.h:18: undefined reference to
testing::internal::UntypedFunctionMockerBase::SetOwnerAndName(void const*, char const*)' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
FunctionMocker':D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1469: undefined reference to
testing::internal::UntypedFunctionMockerBase::UntypedFunctionMockerBase()' D:\ProgramFiles\msys2\mingw64\bin\ld: D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1469: undefined reference to
testing::internal::UntypedFunctionMockerBase::UntypedFunctionMockerBase()'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
~FunctionMocker': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1491: undefined reference to
testing::internal::UntypedFunctionMockerBase::VerifyAndClearExpectationsLocked()'D:\ProgramFiles\msys2\mingw64\bin\ld: D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1492: undefined reference to
testing::Mock::UnregisterLocked(testing::internal::UntypedFunctionMockerBase*)' D:\ProgramFiles\msys2\mingw64\bin\ld: D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1494: undefined reference to
testing::internal::UntypedFunctionMockerBase::~UntypedFunctionMockerBase()'D:\ProgramFiles\msys2\mingw64\bin\ld: D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1494: undefined reference to
testing::internal::UntypedFunctionMockerBase::~UntypedFunctionMockerBase()' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::FunctionMocker<std::__cxx11::basic_string<char, std::char_traits, std::allocator > ()>::UntypedDescribeUninterestingCall(void const*, std::ostream*) const':D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1678: undefined reference to
testing::internal::UntypedFunctionMockerBase::Name() const' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::Action<std::__cxx11::basic_string<char, std::char_traits, std::allocator > ()>::Perform(std::tuple<>) const':D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-actions.h:390: undefined reference to
testing::internal::IllegalDoDefault(char const*, int)' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::Assert(bool, char const*, int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)':D:/ProgramFiles\msys2\mingw64\include\gmock\internal\gmock-internal-utils.h:272: undefined reference to
testing::internal::GetFailureReporter()' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::TypedExpectation<std::__cxx11::basic_string<char, std::char_traits, std::allocator > ()>::GetActionForArguments(testing::internal::FunctionMocker<std::__cxx11::basic_string<char, std::char_traits, std::allocator > ()> const*, std::tuple<> const&, std::ostream*, std::ostream*)':D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1208: undefined reference to
testing::internal::ExpectationBase::DescribeCallCountTo(std::ostream*) const' D:\ProgramFiles\msys2\mingw64\bin\ld: D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1214: undefined reference to
testing::internal::ExpectationBase::RetireAllPreRequisites()'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::TypedExpectation<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > ()>::ShouldHandleArguments(std::tuple<> const&) const': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1109: undefined reference to
testing::internal::ExpectationBase::CheckActionCountIfNotDone() const'D:\ProgramFiles\msys2\mingw64\bin\ld: D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1110: undefined reference to
testing::internal::ExpectationBase::AllPrerequisitesAreSatisfied() const' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::FunctionMocker<std::__cxx11::basic_string<char, std::char_traits, std::allocator > ()>::PrintTriedExpectationsLocked(std::tuple<> const&, std::ostream*) const':D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1784: undefined reference to
testing::internal::ExpectationBase::DescribeCallCountTo(std::ostream*) const' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::TypedExpectation<std::__cxx11::basic_string<char, std::char_traits, std::allocator > ()>::ExplainMatchResultTo(std::tuple<> const&, std::ostream*) const':D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1137: undefined reference to
testing::internal::ExpectationBase::AllPrerequisitesAreSatisfied() const' D:\ProgramFiles\msys2\mingw64\bin\ld: D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1142: undefined reference to
testing::internal::ExpectationBase::FindUnsatisfiedPrerequisites(testing::ExpectationSet*) const'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
void __gnu_cxx::new_allocator<std::_Rb_tree_node<testing::Expectation> >::destroy<testing::Expectation>(testing::Expectation*)': D:\/ProgramFiles\msys2\mingw64\include\c++\10.2.0\ext\new_allocator.h:156: undefined reference to
testing::Expectation::~Expectation()'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::TypedExpectation<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > ()>::GetCurrentAction(testing::internal::FunctionMocker<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > ()> const*, std::tuple<> const&) const': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1181: undefined reference to
testing::internal::Log(testing::internal::LogSeverity, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int)'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
~FunctionMocker': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1491: undefined reference to
testing::internal::UntypedFunctionMockerBase::VerifyAndClearExpectationsLocked()'D:\ProgramFiles\msys2\mingw64\bin\ld: D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1492: undefined reference to
testing::Mock::UnregisterLocked(testing::internal::UntypedFunctionMockerBase*)' D:\ProgramFiles\msys2\mingw64\bin\ld: D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1494: undefined reference to
testing::internal::UntypedFunctionMockerBase::~UntypedFunctionMockerBase()'D:\ProgramFiles\msys2\mingw64\bin\ld: D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1494: undefined reference to
testing::internal::UntypedFunctionMockerBase::~UntypedFunctionMockerBase()' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::FunctionMocker<int ()>::UntypedDescribeUninterestingCall(void const*, std::ostream*) const':D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1678: undefined reference to
testing::internal::UntypedFunctionMockerBase::Name() const' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::Action<int ()>::Perform(std::tuple<>) const':D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-actions.h:390: undefined reference to
testing::internal::IllegalDoDefault(char const*, int)' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::TypedExpectation<int ()>::GetActionForArguments(testing::internal::FunctionMocker<int ()> const*, std::tuple<> const&, std::ostream*, std::ostream*)':D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1208: undefined reference to
testing::internal::ExpectationBase::DescribeCallCountTo(std::ostream*) const' D:\ProgramFiles\msys2\mingw64\bin\ld: D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1214: undefined reference to
testing::internal::ExpectationBase::RetireAllPreRequisites()'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::TypedExpectation<int ()>::ShouldHandleArguments(std::tuple<> const&) const': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1109: undefined reference to
testing::internal::ExpectationBase::CheckActionCountIfNotDone() const'D:\ProgramFiles\msys2\mingw64\bin\ld: D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1110: undefined reference to
testing::internal::ExpectationBase::AllPrerequisitesAreSatisfied() const' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::FunctionMocker<int ()>::PrintTriedExpectationsLocked(std::tuple<> const&, std::ostream*) const':D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1784: undefined reference to
testing::internal::ExpectationBase::DescribeCallCountTo(std::ostream*) const' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::TypedExpectation<int ()>::ExplainMatchResultTo(std::tuple<> const&, std::ostream*) const':D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1137: undefined reference to
testing::internal::ExpectationBase::AllPrerequisitesAreSatisfied() const' D:\ProgramFiles\msys2\mingw64\bin\ld: D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1142: undefined reference to
testing::internal::ExpectationBase::FindUnsatisfiedPrerequisites(testing::ExpectationSet*) const'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::TypedExpectation<int ()>::GetCurrentAction(testing::internal::FunctionMocker<int ()> const*, std::tuple<> const&) const': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1181: undefined reference to
testing::internal::Log(testing::internal::LogSeverity, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int)'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::FunctionMocker<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > ()>::Invoke()': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1600: undefined reference to
testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith(void*)'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::FunctionMocker<int ()>::Invoke()': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1600: undefined reference to
testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith(void*)'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::FunctionMocker<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > ()>::AddNewExpectation(char const*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::tuple<> const&)': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1630: undefined reference to
testing::internal::UntypedFunctionMockerBase::MockObject() const'D:\ProgramFiles\msys2\mingw64\bin\ld: D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1630: undefined reference to
testing::Mock::RegisterUseByOnCallOrExpectCall(void const*, char const*, int)' D:\ProgramFiles\msys2\mingw64\bin\ld: D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1641: undefined reference to
testing::Expectation::Expectation(std::shared_ptrtesting::internal::ExpectationBase const&)'D:\ProgramFiles\msys2\mingw64\bin\ld: D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1641: undefined reference to
testing::Sequence::AddExpectation(testing::Expectation const&) const' D:\ProgramFiles\msys2\mingw64\bin\ld: D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1641: undefined reference to
testing::Expectation::~Expectation()'D:\ProgramFiles\msys2\mingw64\bin\ld: D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1641: undefined reference to
testing::Expectation::~Expectation()' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
TypedExpectation':D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:897: undefined reference to
testing::internal::ExpectationBase::ExpectationBase(char const*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' D:\ProgramFiles\msys2\mingw64\bin\ld: D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:904: undefined reference to
testing::internal::ExpectationBase::~ExpectationBase()'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
~TypedExpectation': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:909: undefined reference to
testing::internal::ExpectationBase::CheckActionCountIfNotDone() const'D:\ProgramFiles\msys2\mingw64\bin\ld: D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:914: undefined reference to
testing::internal::ExpectationBase::~ExpectationBase()' D:\ProgramFiles\msys2\mingw64\bin\ld: D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:914: undefined reference to
testing::internal::ExpectationBase::~ExpectationBase()'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::TypedExpectation<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > ()>::GetHandle()': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1086: undefined reference to
testing::internal::UntypedFunctionMockerBase::GetHandleOf(testing::internal::ExpectationBase*)'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::TypedExpectation<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > ()>::Times(testing::Cardinality const&)': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:936: undefined reference to
testing::internal::ExpectationBase::UntypedTimes(testing::Cardinality const&)'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::Expect(bool, char const*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': D:\/ProgramFiles\msys2\mingw64\include\gmock\internal\gmock-internal-utils.h:285: undefined reference to
testing::internal::GetFailureReporter()'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::FunctionMocker<int ()>::AddNewExpectation(char const*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::tuple<> const&)': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1630: undefined reference to
testing::internal::UntypedFunctionMockerBase::MockObject() const'D:\ProgramFiles\msys2\mingw64\bin\ld: D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1630: undefined reference to
testing::Mock::RegisterUseByOnCallOrExpectCall(void const*, char const*, int)' D:\ProgramFiles\msys2\mingw64\bin\ld: D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1641: undefined reference to
testing::Expectation::Expectation(std::shared_ptrtesting::internal::ExpectationBase const&)'D:\ProgramFiles\msys2\mingw64\bin\ld: D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1641: undefined reference to
testing::Sequence::AddExpectation(testing::Expectation const&) const' D:\ProgramFiles\msys2\mingw64\bin\ld: D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1641: undefined reference to
testing::Expectation::~Expectation()'D:\ProgramFiles\msys2\mingw64\bin\ld: D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1641: undefined reference to
testing::Expectation::~Expectation()' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
TypedExpectation':D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:897: undefined reference to
testing::internal::ExpectationBase::ExpectationBase(char const*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' D:\ProgramFiles\msys2\mingw64\bin\ld: D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:904: undefined reference to
testing::internal::ExpectationBase::~ExpectationBase()'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
~TypedExpectation': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:909: undefined reference to
testing::internal::ExpectationBase::CheckActionCountIfNotDone() const'D:\ProgramFiles\msys2\mingw64\bin\ld: D:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:914: undefined reference to
testing::internal::ExpectationBase::~ExpectationBase()' D:\ProgramFiles\msys2\mingw64\bin\ld: D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:914: undefined reference to
testing::internal::ExpectationBase::~ExpectationBase()'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj): in function
testing::internal::TypedExpectation<int ()>::GetHandle()': D:\/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:1086: undefined reference to
testing::internal::UntypedFunctionMockerBase::GetHandleOfD:/ProgramFiles\msys2\mingw64\include\gmock\gmock-spec-builders.h:936: undefined reference totesting::internal::ExpectationBase::UntypedTimes(testing::Cardinality const&)' D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj):gdemo_test.cpp:(.rdata$.refptr._ZN7testing8internal13g_gmock_mutexE[.refptr._ZN7testing8internal13g_gmock_mutexE]+0x0): undefined reference to
testing::internal::g_gmock_mutex'D:\ProgramFiles\msys2\mingw64\bin\ld: CMakeFiles\gdemo_test.dir/objects.a(gdemo_test.cpp.obj):gdemo_test.cpp:(.rdata$.refptr._ZN7testing8internal25g_gmock_implicit_sequenceE[.refptr._ZN7testing8internal25g_gmock_implicit_sequenceE]+0x0): undefined reference to `testing::internal::g_gmock_implicit_sequence'
mingw32-make[2]: *** [CMakeFiles\gdemo_test.dir\build.make:86: gdemo_test.exe] Error 1
mingw32-make[2]: Leaving directory 'D:/Yesire-Lincoln/ProgramingHub/CandCpp/demoTryClang/build'
mingw32-make[1]: *** [CMakeFiles\Makefile2:103: CMakeFiles/gdemo_test.dir/all] Error 2
mingw32-make[1]: Leaving directory 'D:/Yesire-Lincoln/ProgramingHub/CandCpp/demoTryClang/build'
mingw32-make: *** [Makefile:83: all] Error 2
Beta Was this translation helpful? Give feedback.
All reactions