gcc 6.0編譯opencv出錯

在編譯opencv3.2時候,出現下面錯誤: cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_NEW_PYTHON_SUPPORT=ON -DINSTALL_PYTHON_EXAMPLES=ON -DWITH_TBB=ON -DWITH_V4L=ON -DINSTALL_C_EXAMPLES=ON -DBUILD_EXAMPLES=ON -DWITH_QT=ON -DWITH_OPENGL=ON -DWITH_OPENCL=ON -DWITH_EIGEN=ON -DWITH_OPENEXR=ON
In file included from /usr/local/include/c++/6.2.0/bits/stl_algo.h:59:0, from /usr/local/include/c++/6.2.0/algorithm:62, from /home/dmelo/proj2/opencv/modules/core/include/opencv2/core/base.hpp:55, from /home/dmelo/proj2/opencv/modules/core/include/opencv2/core.hpp:54, from /home/dmelo/proj2/opencv/modules/highgui/include/opencv2/highgui.hpp:46, from /home/dmelo/proj2/opencv/build/modules/highgui/precomp.hpp:45: /usr/local/include/c++/6.2.0/cstdlib:75:25: fatal error: stdlib.h: No such file or directory #include_next <stdlib.h> ^ compilation terminated.

加入下面編譯選項:c++

-DENABLE_PRECOMPILED_HEADERS=OFF 編譯正常。
相關文章
相關標籤/搜索