Linking Error: testing::internal::InsertSyntheticTestCase(std::string const&, testing::internal::CodeLocation, bool) #4760
Unanswered
Alok-Ranjan23
asked this question in
Community Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am able to build my testing code using gtest/gtest.h includes, but facing linking problem. I am getting the following linking issue.
/usr/bin/ld: CMakeFiles/gtests.dir/test_linear.cpp.o: in function
testing::internal::ParameterizedTestSuiteInfo::RegisterTests()':test_linear.cpp:(.text._ZN7testing8internal26ParameterizedTestSuiteInfoI10TestLinearE13RegisterTestsEv[_ZN7testing8internal26ParameterizedTestSuiteInfoI10TestLinearE13RegisterTestsEv]+0xdb3): undefined reference to
testing::internal::MakeAndRegisterTestInfo(std::string, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)' /usr/bin/ld: test_linear.cpp:(.text._ZN7testing8internal26ParameterizedTestSuiteInfoI10TestLinearE13RegisterTestsEv[_ZN7testing8internal26ParameterizedTestSuiteInfoI10TestLinearE13RegisterTestsEv]+0x1aa3): undefined reference to
testing::internal::InsertSyntheticTestCase(std::string const&, testing::internal::CodeLocation, bool)'collect2: error: ld returned 1 exit status`
Before that, I have build googletest/googlemock framework locally.
What can be the problem here? Am I not building the googletest framework properly [i.e. Am I missing some flags before building gtests]?
Please help me here.
Beta Was this translation helpful? Give feedback.
All reactions