Ask Your Question

Revision history [back]

[problem]:Using OpenCV with gcc and CMake

i study opencv toturials,have a problem

first:i create file DisplayImage.cpp and CMakeLists.txt file

DisplayImage.cpp content :

include <stdio.h>

include <opencv2 opencv.hpp="">

using namespace cv; int main(int argc, char** argv ) { if ( argc != 2 ) { printf("usage: DisplayImage.out <image_path>\n"); return -1; } Mat image; image = imread( argv[1], 1 ); if ( !image.data ) { printf("No image data \n"); return -1; } namedWindow("Display Image", WINDOW_AUTOSIZE ); imshow("Display Image", image); waitKey(0); return 0; }

CMakeLists.txt file content: cmake_minimum_required(VERSION 2.8) project( DisplayImage ) find_package( OpenCV REQUIRED ) include_directories( ${OpenCV_INCLUDE_DIRS} ) add_executable( DisplayImage DisplayImage.cpp ) target_link_libraries( DisplayImage ${OpenCV_LIBS} )

second i input .make on my terminal (tensorflow) [email protected]:~/opencv$ cmake . -- The C compiler identification is GNU 5.5.0 -- The CXX compiler identification is GNU 4.8.5 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found OpenCV: /home/chentao/anaconda3/envs/tensorflow (found version "3.4.1") -- Configuring done -- Generating done -- Build files have been written to: /home/chentao/opencv

Third i input make on terminal (tensorflow) [email protected]:~/opencv$ make Scanning dependencies of target DisplayImage [ 50%] Building CXX object CMakeFiles/DisplayImage.dir/DisplayImage.cpp.o [100%] Linking CXX executable DisplayImage /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> > const&)@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned long)@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference tostd::__cxx11::basic_ostringstream<char, std::char_traits<char="">, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::resize(unsigned long, char)@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference tovtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char="">, std::allocator<char> >@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned long)@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> >::compare(std::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> > const&) [email protected]_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char, unsigned long) [email protected]_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference tostd::__cxx11::basic_stringstream<char, std::char_traits<char="">, std::allocator<char> >::~basic_stringstream()@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*)@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference tovtable for std::__cxx11::basic_stringstream<char, std::char_traits<char="">, std::allocator<char> >@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_aux(unsigned long, unsigned long, unsigned long, char)@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference tostd::basic_istream<char, std::char_traits<char=""> >& std::getline<char, std::char_traits<char="">, std::allocator<char> >(std::basic_istream<char, std::char_traits<char=""> >&, std::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> >&, char)@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::_M_sync(char*, unsigned long, unsigned long)@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference tostd::__cxx11::basic_stringstream<char, std::char_traits<char="">, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to std::basic_istream<char, std::char_traits<char> >& std::operator>><char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference tostd::__cxx11::basic_ostringstream<char, std::char_traits<char="">, std::allocator<char> >::~basic_ostringstream()@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to vtable for std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> >::compare(char const) [email protected]_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() [email protected]_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference toVTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char="">, std::allocator<char> >@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_istringstream()@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference toVTT for std::__cxx11::basic_istringstream<char, std::char_traits<char="">, std::allocator<char> >@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> >::_M_mutate(unsigned long, unsigned long, char const, unsigned long)@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)@GLIBCXX_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> >::find(char const, unsigned long, unsigned long) [email protected]_3.4.21' /home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> >::rfind(char, unsigned long) [email protected]_3.4.21' collect2: error: ld returned 1 exit status make[2]: [DisplayImage] Error 1 make[1]: [CMakeFiles/DisplayImage.dir/all] Error 2 make: ** [all] Error 2

please help me , thanks advantaged T^T

click to hide/show revision 2
None

updated 2018-07-10 23:52:58 -0500

berak gravatar image

[problem]:Using OpenCV with gcc and CMake

i study opencv toturials,have a problem

first:i create file DisplayImage.cpp and CMakeLists.txt file

DisplayImage.cpp content :

include <stdio.h>

include <opencv2 opencv.hpp="">

#include <stdio.h>
#include <opencv2/opencv.hpp>
using namespace cv;
int main(int argc, char** argv )
{
    if ( argc != 2 )
    {
        printf("usage: DisplayImage.out <image_path>\n");
<Image_Path>\n");
        return -1;
    }
    Mat image;
    image = imread( argv[1], 1 );
    if ( !image.data )
    {
        printf("No image data \n");
        return -1;
    }
    namedWindow("Display Image", WINDOW_AUTOSIZE );
    imshow("Display Image", image);
    waitKey(0);
    return 0;
}

}

CMakeLists.txt file content: content:

cmake_minimum_required(VERSION 2.8)
project( DisplayImage )
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
add_executable( DisplayImage DisplayImage.cpp )
target_link_libraries( DisplayImage ${OpenCV_LIBS} )

)

second i input .make on my terminal terminal

(tensorflow) [email protected]:~/opencv$ cmake .
-- The C compiler identification is GNU 5.5.0
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenCV: /home/chentao/anaconda3/envs/tensorflow (found version "3.4.1") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/chentao/opencv

/home/chentao/opencv

Third i input make on terminal terminal

(tensorflow) [email protected]:~/opencv$ make
Scanning dependencies of target DisplayImage
[ 50%] Building CXX object CMakeFiles/DisplayImage.dir/DisplayImage.cpp.o
[100%] Linking CXX executable DisplayImage
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to VTT `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char="">, to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char="">, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to std::__cxx11::basic_string<char, `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned long)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference toto `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::resize(unsigned long, char)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char="">, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::resize(unsigned long, char)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference tovtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char="">, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to std::__cxx11::basic_string<char, `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned long)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char="">, to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::__cxx11::basic_string<char, std::char_traits<char="">, std::char_traits<char>, std::allocator<char> > const&) [email protected]_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to std::__cxx11::basic_string<char, `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char, unsigned long) [email protected]_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference tostd::__cxx11::basic_stringstream<char, std::char_traits<char="">, to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to std::__cxx11::basic_string<char, `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference tovtable to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char="">, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to vtable `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char="">, to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to std::__cxx11::basic_string<char, `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_aux(unsigned long, unsigned long, unsigned long, char)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference tostd::basic_istream<char, std::char_traits<char=""> to `std::basic_istream<char, std::char_traits<char> >& std::getline<char, std::char_traits<char="">, std::allocator<char> >(std::basic_istream<char, std::char_traits<char=""> >&, std::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> >&, char)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::_M_sync(char*, unsigned long, unsigned long)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference tostd::__cxx11::basic_stringstream<char, std::char_traits<char="">, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to std::basic_istream<char, std::char_traits<char> >& std::operator>><char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, char)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::_M_sync(char*, unsigned long, unsigned long)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to `std::basic_istream<char, std::char_traits<char> >& std::operator>><char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference tostd::__cxx11::basic_ostringstream<char, std::char_traits<char="">, to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream()@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to vtable `vtable for std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char="">, to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const) const*) [email protected]_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to std::__cxx11::basic_stringbuf<char, `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() [email protected]_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference toVTT to `VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char="">, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to `std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_istringstream()@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to `VTT for std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_istringstream()@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference toVTT for std::__cxx11::basic_istringstream<char, std::char_traits<char="">, std::allocator<char> >@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference to std::__cxx11::basic_string<char, `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_core.so.3.4.1: undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char="">, to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate(unsigned long, unsigned long, char const, unsigned long)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char="">, to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)@GLIBCXX_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char const, const*, unsigned long, unsigned long) [email protected]_3.4.21'
/home/chentao/anaconda3/envs/tensorflow/lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char="">, std::char_traits<char>, std::allocator<char> >::rfind(char, unsigned long) [email protected]_3.4.21'
collect2: error: ld returned 1 exit status
make[2]:  *** [DisplayImage] Error 1
make[1]:  *** [CMakeFiles/DisplayImage.dir/all] Error 2
make: ** *** [all] Error 2

2

please help me , thanks advantaged T^T