alyssaq/reconstruction

Issue with traits.hpp

Closed this issue · 1 comments

While compiling example_sfm.cpp, got the following issue,

reconstruction(master)$ g++ example_sfm.cpp -I /usr/include/eigen3/ -I/usr/local/include/opencv -I/usr/local/include/opencv2 -L /usr/local/share/OpenCV/3rdparty/lib/ -L/usr/local/lib/ -L /usr/include/eigen3/ -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_optflow -lopencv_sfm -lopencv_viz
In file included from /usr/local/include/opencv2/core.hpp:56:0,
from /usr/local/include/opencv2/sfm/conditioning.hpp:39,
from /usr/local/include/opencv2/sfm.hpp:39,
from example_sfm.cpp:3:
/usr/local/include/opencv2/core/traits.hpp: In instantiation of ‘struct cv::traits::Type<std::__cxx11::basic_string >’:
/usr/local/include/opencv2/core/mat.inl.hpp:85:32: required from ‘cv::_InputArray::_InputArray(const std::vector<_Tp>&) [with _Tp = std::__cxx11::basic_string]’
example_sfm.cpp:66:86: required from here
/usr/local/include/opencv2/core/traits.hpp:366:8: error: ‘type’ is not a member of ‘cv::DataType<std::__cxx11::basic_string >’
{ enum { value = DataType::type }; };
^
reconstruction(master)$ pkg-config --modversion opencv
3.4.0

Please let me know the solution.

Fixed by using cv::String over std::string