Closed horcham closed 5 years ago
Hello, I can't help you with that. It also took me lots of time to get all libraries correct. My CMakeLists.txt is modified from 视觉SLAM十四讲: https://github.com/gaoxiang12/slambook/blob/master/project/0.4/CMakeLists.txt Maybe you can find answers there.
When
make
, it showserror: #error "OpenCV 4.x+ requires enabled C++11 support"
, and it seems OpenCV version lower than 3.4.0 can work, but this project recommand OpenCV version higher than 3.4.5. I try to add-DCMAKE_CXX_FLAGS="-std=c++11"
but failed. And how to solve the problem above?
如果你使用的是Ubuntu16,需要把作者的CMakeLists.txt中关于std11的那句:
# set( CMAKE_CXX_FLAGS "-std=c++11 -O3" )
改为:
add_compile_options(-std=c++11)
如果你使用的是Ubuntu18则不需要做上述更改。我使用的opencv版本为3.4.7
When
make
, it showserror: #error "OpenCV 4.x+ requires enabled C++11 support"
, and it seems OpenCV version lower than 3.4.0 can work, but this project recommand OpenCV version higher than 3.4.5. I try to add-DCMAKE_CXX_FLAGS="-std=c++11"
but failed. And how to solve the problem above?