title: undefined reference to testing::internal::EqFailure in gtest
body: <p>I am trying to do a test for a function using GoogleTest an now it is not finding anymore the <code>EqFailure</code> <em>thing</em>:</p>
  
  <pre><code>/usr/include/gtest/gtest.h:1337: undefined reference to `testing::internal::EqFailure(char const*, char const*, testing::internal::String const&amp;, testing::internal::String const&amp;, bool)'
  </code></pre>
  
  <p>I am writing the test like this:</p>
  
  <p><strong>test_file.cpp</strong>:</p>
  
  <pre><code>#include &lt;gtest/gtest.h&gt;
  
  #include "tools/CMorphology.hpp"
  
  TEST(erode_Morph, crossKernel_Morph)
  {
    // initialize matrix to be eroded
    cv::Mat matrix = (cv::Mat_&lt;uchar&gt;(5, 5) &lt;&lt; 1, 1, 1, 1, 1,
                                               1, 1, 0, 1, 1,
                                               1, 1, 1, 1, 1,
                                               1, 0, 1, 1, 1,
                                               1, 1, 1, 1, 1
              );
    // initialize the cross kernel
    cv::Mat kernel = cv::getStructuringElement(cv::MORPH_CROSS, cv::Size(3, 3));
    // initialize the vector expected as output
    cv::Mat verMat = (cv::Mat_&lt;uchar&gt;(5, 5) &lt;&lt; 1, 1, 0, 1, 1,
                                               1, 0, 0, 0, 1,
                                               1, 0, 0, 1, 1,
                                               0, 0, 0, 1, 1,
                                               1, 0, 1, 1, 1);
  
    // call erode(...)
    Morphology morphology;
    cv::Mat matrixOut;
    morphology.erode(matrix, kernel, matrixOut);
  
    for (int i = 0; i &lt; matrixOut.rows; i++)
    {
      for (int j = 0; j &lt; matrixOut.rows; j++)
      {
        EXPECT_EQ(matrixOut.ptr&lt;uchar&gt;(i)[j], verMat.ptr&lt;uchar&gt;(i)[j]);
      }
    }
  }
  </code></pre>
  
  <p>I am using OpenCV and if needed, I'll post the other files.</p>
  
  <p><code>CMake</code> file is here:</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8)
  
  set(EXECUTABLE_NAME lpdetect)
  project(${EXECUTABLE_NAME})
  
  option(DEBUG "Display images for each step" OFF)
  
  if (DEBUG)
          set(CMAKE_CXX_FLAGS "-g -Wall -Wno-unknown-pragmas -Wno-reorder -Wno-sign-compare -Wno-switch -std=gnu++11 -DDISPLAY_IMGS -DBOOST_LOG_DYN_LINK")
  else()
          set(CMAKE_CXX_FLAGS "-g -Wall -Wno-unknown-pragmas -Wno-reorder -Wno-sign-compare -Wno-switch -std=gnu++11 -DBOOST_LOG_DYN_LINK")
  endif()
  
  find_package(OpenCV REQUIRED core
                               imgproc
                               features2d
                               nonfree
                               highgui
                               )
  
  find_package(Boost REQUIRED COMPONENTS filesystem
                                         program_options
                                         system
                                         thread
                                         locale
                                         regex
                                         date_time
                                         log
                                         log_setup
                                         timer
                                         )
  
  include_directories(src/main/cpp
                      ${Boost_INCLUDE_DIRS}
                      ${OpenCV2_INCLUDE_DIRS}
                      )
  
  add_executable( ${EXECUTABLE_NAME}
                               src/main/cpp/main.cpp
  # and the other files
                               )
  
  target_link_libraries(${EXECUTABLE_NAME} ${OpenCV_LIBS}
                                           "-laws-cpp"
                                           "-lcasablanca"
                                           ${Boost_LIBRARIES}
                                           "-lcrypto"
                                           )
  
  
  find_package(GTest REQUIRED gtest_main
                              pthread)
  
  enable_testing()
  
  include_directories( ${GTEST_INCLUDE_DIRS} )
  
  add_executable(${EXECUTABLE_NAME}_test src/test/cpp/test_Morphology.cpp
                                         src/main/cpp/tools/CMorphology.cpp
                                         src/main/cpp/tools/CMorphology.hpp
                         )
  
  target_link_libraries(${EXECUTABLE_NAME}_test
                                         ${OpenCV_LIBRARIES}
                                         ${Boost_LIBRARIES}
                                         ${GTEST_LIBRARIES}
                                         )
  
  add_test(${EXECUTABLE_NAME}_test
           ${EXECUTABLE_NAME}_test
           )
  </code></pre>
  
  <p>I have done this a wile ago, and after some commits it is displaying this error. Why does it no longer find that?</p>