I'm getting this linker error when using
ASSERT_THAT(std::vector<int>({1, 2, 3}), ::testing::UnorderedElementsAreArray({1, 2, 3}));
Linker error:
/usr/local/include/gmock/gmock-matchers.h:3369: undefined reference to 'testing::internal::UnorderedElementsAreMatcherImplBase::DescribeToImpl(std::ostream*) const'
But it compiles and links fine when
ASSERT_THAT(std::vector<int>({1, 2, 3}), ::testing::ElementsAreArray({1, 2, 3}));
I freshly compiled it using the latest master at bfc0ffc8a698072c794ae7299db9cb6866f4c0bc using with GCC 7.1
Turns out, while ::testing::ElementsAreArray does not require libgmock library, ::testing::UnorderedElementsAreArray does, which I foolishly forgotten to link.
Most helpful comment
Turns out, while
::testing::ElementsAreArraydoes not requirelibgmocklibrary,::testing::UnorderedElementsAreArraydoes, which I foolishly forgotten to link.