DSO安装编译报错:“error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope”
- 测试环境:Jetson Xavier NX+ Jetpack4.4 + Ubuntu 1804 + ROS Melodic + opencv4.1.1
错误提示
[ 56%] Building CXX object CMakeFiles/dso.dir/src/OptimizationBackend/EnergyFunctional.cpp.o
[ 60%] Building CXX object CMakeFiles/dso.dir/src/util/globalCalib.cpp.o
[ 64%] Building CXX object CMakeFiles/dso.dir/src/FullSystem/HessianBlocks.cpp.o
[ 68%] Building CXX object CMakeFiles/dso.dir/src/util/settings.cpp.o
[ 72%] Building CXX object CMakeFiles/dso.dir/src/util/Undistort.cpp.o
[ 76%] Building CXX object CMakeFiles/dso.dir/src/IOWrapper/OpenCV/ImageRW_OpenCV.cpp.o
[ 80%] Building CXX object CMakeFiles/dso.dir/src/IOWrapper/Pangolin/KeyFrameDisplay.cpp.o
[ 84%] Building CXX object CMakeFiles/dso.dir/src/IOWrapper/OpenCV/ImageDisplay_OpenCV.cpp.o
[ 88%] Building CXX object CMakeFiles/dso.dir/src/IOWrapper/Pangolin/PangolinDSOViewer.cpp.o
/home/ubuntu/slam/dso/src/IOWrapper/OpenCV/ImageRW_OpenCV.cpp: In function ‘dso::MinimalImageB* dso::IOWrap::readImageBW_8U(std::__cxx11::string)’:
/home/ubuntu/slam/dso/src/IOWrapper/OpenCV/ImageRW_OpenCV.cpp:37:35: error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope
cv::Mat m = cv::imread(filename, CV_LOAD_IMAGE_GRAYSCALE);
^~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/slam/dso/src/IOWrapper/OpenCV/ImageRW_OpenCV.cpp: In function ‘dso::MinimalImageB3* dso::IOWrap::readImageRGB_8U(std::__cxx11::string)’:
/home/ubuntu/slam/dso/src/IOWrapper/OpenCV/ImageRW_OpenCV.cpp:55:35: error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope
cv::Mat m = cv::imread(filename, CV_LOAD_IMAGE_COLOR);
^~~~~~~~~~~~~~~~~~~
/home/ubuntu/slam/dso/src/IOWrapper/OpenCV/ImageRW_OpenCV.cpp:55:35: note: suggested alternative: ‘CV_HAL_DFT_STAGE_COLS’
cv::Mat m = cv::imread(filename, CV_LOAD_IMAGE_COLOR);
^~~~~~~~~~~~~~~~~~~
CV_HAL_DFT_STAGE_COLS
/home/ubuntu/slam/dso/src/IOWrapper/OpenCV/ImageRW_OpenCV.cpp: In function ‘dso::MinimalImage<short unsigned int>* dso::IOWrap::readImageBW_16U(std::__cxx11::string)’:
/home/ubuntu/slam/dso/src/IOWrapper/OpenCV/ImageRW_OpenCV.cpp:73:35: error: ‘CV_LOAD_IMAGE_UNCHANGED’ was not declared in this scope
cv::Mat m = cv::imread(filename, CV_LOAD_IMAGE_UNCHANGED);
^~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/slam/dso/src/IOWrapper/OpenCV/ImageRW_OpenCV.cpp: In function ‘dso::MinimalImageB* dso::IOWrap::readStreamBW_8U(char*, int)’:
/home/ubuntu/slam/dso/src/IOWrapper/OpenCV/ImageRW_OpenCV.cpp:91:60: error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope
cv::Mat m = cv::imdecode(cv::Mat(numBytes,1,CV_8U, data), CV_LOAD_IMAGE_GRAYSCALE);
^~~~~~~~~~~~~~~~~~~~~~~
CMakeFiles/dso.dir/build.make:518: recipe for target 'CMakeFiles/dso.dir/src/IOWrapper/OpenCV/ImageRW_OpenCV.cpp.o' failed
make[2]: *** [CMakeFiles/dso.dir/src/IOWrapper/OpenCV/ImageRW_OpenCV.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
CMakeFiles/dso.dir/build.make:326: recipe for target 'CMakeFiles/dso.dir/src/OptimizationBackend/EnergyFunctional.cpp.o' failed
make[2]: *** [CMakeFiles/dso.dir/src/OptimizationBackend/EnergyFunctional.cpp.o] Error 4
In file included from /usr/include/eigen3/Eigen/Core:349:0,
from /home/ubuntu/slam/Pangolin/include/pangolin/display/opengl_render_state.h:40,
from /home/ubuntu/slam/Pangolin/include/pangolin/display/viewport.h:31,
from /home/ubuntu/slam/Pangolin/include/pangolin/gl/gl.h:30,
from /home/ubuntu/slam/Pangolin/include/pangolin/pangolin.h:33,
from /home/ubuntu/slam/dso/src/IOWrapper/Pangolin/PangolinDSOViewer.h:26,
from /home/ubuntu/slam/dso/src/IOWrapper/Pangolin/PangolinDSOViewer.cpp:26:
In function ‘void* Eigen::internal::aligned_malloc(std::size_t)’,
inlined from ‘T* Eigen::aligned_allocator<T>::allocate(Eigen::aligned_allocator<T>::size_type, const void*) [with T = Eigen::Matrix<float, 3, 1>]’ at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:742:76,
inlined from ‘static std::allocator_traits<_Alloc>::pointer std::allocator_traits<_Alloc>::allocate(_Alloc&, std::allocator_traits<_Alloc>::size_type) [with _Alloc = Eigen::aligned_allocator<Eigen::Matrix<float, 3, 1> >]’ at /usr/include/c++/7/bits/alloc_traits.h:301:32,
inlined from ‘std::_Vector_base<_Tp, _Alloc>::pointer std::_Vector_base<_Tp, _Alloc>::_M_allocate(std::size_t) [with _Tp = Eigen::Matrix<float, 3, 1>; _Alloc = Eigen::aligned_allocator<Eigen::Matrix<float, 3, 1> >]’ at /usr/include/c++/7/bits/stl_vector.h:172:18,
inlined from ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {Eigen::Matrix<float, 3, 1, 0, 3, 1>}; _Tp = Eigen::Matrix<float, 3, 1>; _Alloc = Eigen::aligned_allocator<Eigen::Matrix<float, 3, 1> >]’ at /usr/include/c++/7/bits/vector.tcc:406:15:
/usr/include/eigen3/Eigen/src/Core/util/Memory.h:159:12: warning: argument 1 value ‘18446744073709551612’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
result = std::malloc(size);
~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
from /usr/include/c++/7/ext/string_conversions.h:41,
from /usr/include/c++/7/bits/basic_string.h:6361,
from /usr/include/c++/7/string:52,
from /usr/include/c++/7/bits/locale_classes.h:40,
from /usr/include/c++/7/bits/ios_base.h:41,
from /usr/include/c++/7/ios:42,
from /usr/include/c++/7/istream:38,
from /usr/include/c++/7/sstream:38,
from /home/ubuntu/slam/Pangolin/include/pangolin/utils/format_string.h:30,
from /home/ubuntu/slam/Pangolin/include/pangolin/utils/assert.h:31,
from /home/ubuntu/slam/Pangolin/include/pangolin/platform.h:80,
from /home/ubuntu/slam/Pangolin/include/pangolin/pangolin.h:30,
from /home/ubuntu/slam/dso/src/IOWrapper/Pangolin/PangolinDSOViewer.h:26,
from /home/ubuntu/slam/dso/src/IOWrapper/Pangolin/PangolinDSOViewer.cpp:26:
/usr/include/stdlib.h: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {Eigen::Matrix<float, 3, 1, 0, 3, 1>}; _Tp = Eigen::Matrix<float, 3, 1>; _Alloc = Eigen::aligned_allocator<Eigen::Matrix<float, 3, 1> >]’:
/usr/include/stdlib.h:539:14: note: in a call to allocation function ‘void* malloc(size_t)’ declared here
extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
^~~~~~
In file included from /usr/include/eigen3/Eigen/Core:349:0,
from /home/ubuntu/slam/Pangolin/include/pangolin/display/opengl_render_state.h:40,
from /home/ubuntu/slam/Pangolin/include/pangolin/display/viewport.h:31,
from /home/ubuntu/slam/Pangolin/include/pangolin/gl/gl.h:30,
from /home/ubuntu/slam/Pangolin/include/pangolin/pangolin.h:33,
from /home/ubuntu/slam/dso/src/IOWrapper/Pangolin/PangolinDSOViewer.h:26,
from /home/ubuntu/slam/dso/src/IOWrapper/Pangolin/PangolinDSOViewer.cpp:26:
In function ‘void* Eigen::internal::aligned_malloc(std::size_t)’,
inlined from ‘T* Eigen::aligned_allocator<T>::allocate(Eigen::aligned_allocator<T>::size_type, const void*) [with T = Eigen::Matrix<float, 3, 1>]’ at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:742:76,
inlined from ‘static std::allocator_traits<_Alloc>::pointer std::allocator_traits<_Alloc>::allocate(_Alloc&, std::allocator_traits<_Alloc>::size_type) [with _Alloc = Eigen::aligned_allocator<Eigen::Matrix<float, 3, 1> >]’ at /usr/include/c++/7/bits/alloc_traits.h:301:32,
inlined from ‘std::_Vector_base<_Tp, _Alloc>::pointer std::_Vector_base<_Tp, _Alloc>::_M_allocate(std::size_t) [with _Tp = Eigen::Matrix<float, 3, 1>; _Alloc = Eigen::aligned_allocator<Eigen::Matrix<float, 3, 1> >]’ at /usr/include/c++/7/bits/stl_vector.h:172:18,
inlined from ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {Eigen::Matrix<float, 3, 1, 0, 3, 1>}; _Tp = Eigen::Matrix<float, 3, 1>; _Alloc = Eigen::aligned_allocator<Eigen::Matrix<float, 3, 1> >]’ at /usr/include/c++/7/bits/vector.tcc:406:15:
/usr/include/eigen3/Eigen/src/Core/util/Memory.h:159:12: warning: argument 1 value ‘18446744073709551612’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
result = std::malloc(size);
~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
from /usr/include/c++/7/ext/string_conversions.h:41,
from /usr/include/c++/7/bits/basic_string.h:6361,
from /usr/include/c++/7/string:52,
from /usr/include/c++/7/bits/locale_classes.h:40,
from /usr/include/c++/7/bits/ios_base.h:41,
from /usr/include/c++/7/ios:42,
from /usr/include/c++/7/istream:38,
from /usr/include/c++/7/sstream:38,
from /home/ubuntu/slam/Pangolin/include/pangolin/utils/format_string.h:30,
from /home/ubuntu/slam/Pangolin/include/pangolin/utils/assert.h:31,
from /home/ubuntu/slam/Pangolin/include/pangolin/platform.h:80,
from /home/ubuntu/slam/Pangolin/include/pangolin/pangolin.h:30,
from /home/ubuntu/slam/dso/src/IOWrapper/Pangolin/PangolinDSOViewer.h:26,
from /home/ubuntu/slam/dso/src/IOWrapper/Pangolin/PangolinDSOViewer.cpp:26:
/usr/include/stdlib.h: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {Eigen::Matrix<float, 3, 1, 0, 3, 1>}; _Tp = Eigen::Matrix<float, 3, 1>; _Alloc = Eigen::aligned_allocator<Eigen::Matrix<float, 3, 1> >]’:
/usr/include/stdlib.h:539:14: note: in a call to allocation function ‘void* malloc(size_t)’ declared here
extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
^~~~~~
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/dso.dir/all' failed
make[1]: *** [CMakeFiles/dso.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
1 个回复
lalala
赞同来自:
参考资料