ubuntu 16.10, OpenCV build fails - stdlib.h missing
Hello,
I'm trying to build OpenCV on Ubuntu 16.10. The build process is interrupted with the error shown below.
Obviously the file "/usr/include/c++/6/stdlib.h" exists in my system. I have tried this with: OpenCV master branch, OpenCV 3.1.0, 3.0.0, 2.4.13.
Could you please give me some clues what can cause this error and how to solve it? All ideas are welcome :)
...
[ 16%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/bitstrm.cpp.o
[ 16%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/rgbe.cpp.o
[ 16%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/exif.cpp.o
[ 16%] Linking CXX shared library ../../lib/libopencv_imgcodecs.so
[ 16%] Built target opencv_imgcodecs
Scanning dependencies of target opencv_highgui_automoc
[ 16%] Automatic moc for target opencv_highgui
Generating moc_window_QT.cpp
[ 16%] Built target opencv_highgui_automoc
Scanning dependencies of target opencv_highgui_pch_dephelp_automoc
[ 16%] Automatic moc for target opencv_highgui_pch_dephelp
[ 16%] Built target opencv_highgui_pch_dephelp_automoc
Scanning dependencies of target opencv_highgui_pch_dephelp
[ 16%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui_pch_dephelp.dir/opencv_highgui_pch_dephelp.cxx.o
[ 16%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui_pch_dephelp.dir/opencv_highgui_pch_dephelp_automoc.cpp.o
[ 16%] Linking CXX static library ../../lib/libopencv_highgui_pch_dephelp.a
[ 16%] Built target opencv_highgui_pch_dephelp
Scanning dependencies of target pch_Generate_opencv_highgui
[ 16%] Generating precomp.hpp
[ 16%] Generating precomp.hpp.gch/opencv_highgui_RELEASE.gch
In file included from /usr/include/c++/6/bits/stl_algo.h:59:0,
from /usr/include/c++/6/algorithm:62,
from /home/alice/opencv/opencv-master/modules/core/include/opencv2/core/base.hpp:55,
from /home/alice/opencv/opencv-master/modules/core/include/opencv2/core.hpp:54,
from /home/alice/opencv/opencv-master/modules/highgui/include/opencv2/highgui.hpp:46,
from /home/alice/opencv/opencv-master/build/modules/highgui/precomp.hpp:45:
/usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^
compilation terminated.
modules/highgui/CMakeFiles/pch_Generate_opencv_highgui.dir/build.make:62: recipe for target 'modules/highgui/precomp.hpp.gch/opencv_highgui_RELEASE.gch' failed
make[2]: *** [modules/highgui/precomp.hpp.gch/opencv_highgui_RELEASE.gch] Error 1
CMakeFiles/Makefile2:4061: polecenia dla obiektu 'modules/highgui/CMakeFiles/pch_Generate_opencv_highgui.dir/all' failed
make[1]: *** [modules/highgui/CMakeFiles/pch_Generate_opencv_highgui.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2