attention-tracker icon indicating copy to clipboard operation
attention-tracker copied to clipboard

installation crashes

Open kingjr opened this issue 7 years ago • 1 comments

Hi,

Thanks a lot for your package. I'm unfortunately encountering an error when building:

>> make

...

[ 96%] Linking CXX executable head_pose_single_frame
CMakeFiles/head_pose_single_frame.dir/samples/head_pose_estimation_single_frame.cpp.o: In function `main':
head_pose_estimation_single_frame.cpp:(.text.startup+0x200): undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
head_pose_estimation_single_frame.cpp:(.text.startup+0x563): undefined reference to `cv::imwrite(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'
libhead_pose_estimation.so: undefined reference to `cv::Exception::Exception(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
libhead_pose_estimation.so: undefined reference to `cv::putText(cv::Mat&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)'
collect2: error: ld returned 1 exit status
CMakeFiles/head_pose_single_frame.dir/build.make:111: recipe for target 'head_pose_single_frame' failed
make[2]: *** [head_pose_single_frame] Error 1
CMakeFiles/Makefile2:105: recipe for target 'CMakeFiles/head_pose_single_frame.dir/all' failed
make[1]: *** [CMakeFiles/head_pose_single_frame.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

the cmake generated this ouput:

cmake -DDLIB_PATH=/home/jrking/git/dlib/
-- C++11 activated.
-- Searching for BLAS and LAPACK
-- Checking for module 'cblas'
--   No package 'cblas' found
-- Checking for module 'lapack'
--   No package 'lapack' found
-- Found Intel MKL BLAS/LAPACK library
-- OpenCV version: 2.4.11
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jrking/git/attention-tracker

Would you have any hint on what I should do?

kingjr avatar Nov 28 '16 20:11 kingjr

The linker does not find cv::imread(std::__cxx11::basic_string: this is due to your opencv libraries being compiled with a pre-C++11 compiler, and you trying to compile with a C++11 compiler (the 'dual ABI' issue).

Have a look here for instance to see how to fix that problem: http://stackoverflow.com/questions/33394934/converting-std-cxx11string-to-stdstring

severin-lemaignan avatar Nov 29 '16 09:11 severin-lemaignan