Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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 :)

[ 14%] Built target opencv_imgproc
Scanning dependencies of target opencv_imgcodecs
[ 14%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/loadsave.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/utils.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_base.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_bmp.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_exr.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_gdal.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_gdcm.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_hdr.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_jpeg.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_jpeg2000.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_pam.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_png.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_pxm.cpp.o
[ 16%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_sunras.cpp.o
[ 16%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_tiff.cpp.o
[ 16%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_webp.cpp.o
[ 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

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 :)

[ 14%] Built target opencv_imgproc
Scanning dependencies of target opencv_imgcodecs
[ 14%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/loadsave.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/utils.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_base.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_bmp.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_exr.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_gdal.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_gdcm.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_hdr.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_jpeg.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_jpeg2000.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_pam.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_png.cpp.o
[ 15%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_pxm.cpp.o
[ 16%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_sunras.cpp.o
[ 16%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_tiff.cpp.o
[ 16%] Building CXX object modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/grfmt_webp.cpp.o
...
[ 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