I am trying to compile a C++ code in ROS indigo using catkin_make under Ubuntu 14.04. I am getting the following error:
/usr/local/include/opencv2/nonfree/features2d.hpp:73:21: error: ‘vector’ has not been declared
vector<KeyPoint>& keypoints) const;
^
/usr/local/include/opencv2/nonfree/features2d.hpp:73:27: error: expected ‘,’ or ‘...’ before ‘<’ token
vector<KeyPoint>& keypoints) const;
^
/usr/local/include/opencv2/nonfree/features2d.hpp:77:21: error: ‘vector’ has not been declared
vector<KeyPoint>& keypoints,
^
/usr/local/include/opencv2/nonfree/features2d.hpp:77:27: error: expected ‘,’ or ‘...’ before ‘<’ token
vector<KeyPoint>& keypoints,
Does anyone has a clue, what the issue might be? Note that this error is occurring in the feature2d.hpp from OpenCV (so its not a file I made). I already tried to reinstall OpenCV and also ROS, but that did not fix the error.
I would be very thankful if anyone has any idea how to solve that.
Thanks,
snow
Edit: Here is the CMakeLists.txt:
cmake_minimum_required (VERSION 2.8.3)
project (test)
set (test_VERSION "1.0.0")
find_package( OpenCV REQUIRED )
if ( NOT OpenCV_FOUND )
message(FATAL_ERROR "Package OpenCV required, but not found!")
endif( NOT OpenCV_FOUND )
find_package( Eigen3 REQUIRED )
include_directories(
${EIGEN3_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${OpenCV_INCLUDE_DIRS}
)
set (SOURCE
src/test.cpp)
add_library (test ${SOURCE})
set_target_properties (test PROPERTIES
COMPILE_FLAGS "-std=c++11")
target_link_libraries( test ${OpenCV_LIBS} ${EIGEN3_LIBRARY_DIRS})
CMakeLists.txt?CMakeLists.txtthere.CMakeLists.txtat the end of my question.