Created attachment 471810 [details] complete_build_log I'm on ~amd64, I did upgrade sys-devel/gcc to 6.3.0 and I was doing rebuild of all stuff linked against libstdc++, opencv seems to fail, similar to #597912 part of the error message (complete build log attached): eamer-1.0" -isystem"/usr/include/glib-2.0" -isystem"/usr/lib64/glib-2.0/include" -isystem"/usr/include/gstreamer-1.0" -isystem"/usr/include/glib-2.0" -isystem"/usr/lib64/glib-2.0/include" -isystem"/usr/include/gstreamer-1.0" -isystem"/usr/include/glib-2.0" -isystem"/usr/lib64/glib-2.0/include" -I"/var/tmp/portage/media-libs/opencv-3.2.0/work/opencv-3.2.0/modules/highgui/include" -I"/var/tmp/portage/media-libs/opencv-3.2.0/work/opencv-3.2.0/modules/highgui/src" -I"/var/tmp/portage/media-libs/opencv-3.2.0/work/opencv-3.2.0_build/modules/highgui" -I"/var/tmp/portage/media-libs/opencv-3.2.0/work/opencv-3.2.0/modules/core/include" -I"/var/tmp/portage/media-libs/opencv-3.2.0/work/opencv-3.2.0/modules/imgproc/include" -I"/var/tmp/portage/media-libs/opencv-3.2.0/work/opencv-3.2.0/modules/imgcodecs/include" -I"/var/tmp/portage/media-libs/opencv-3.2.0/work/opencv-3.2.0/modules/videoio/include" -O2 -pipe -march=native -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fno-omit-frame-pointer -mno-sse2 -mno-avx -mno-sse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -DCVAPI_EXPORTS -x c++-header -o /var/tmp/portage/media-libs/opencv-3.2.0/work/opencv-3.2.0_build/modules/highgui/precomp.hpp.gch/opencv_highgui_Gentoo.gch /var/tmp/portage/media-libs/opencv-3.2.0/work/opencv-3.2.0_build/modules/highgui/precomp.hpp In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/bits/stl_algo.h:59:0, from /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/algorithm:62, from /var/tmp/portage/media-libs/opencv-3.2.0/work/opencv-3.2.0/modules/core/include/opencv2/core/base.hpp:55, from /var/tmp/portage/media-libs/opencv-3.2.0/work/opencv-3.2.0/modules/core/include/opencv2/core.hpp:54, from /var/tmp/portage/media-libs/opencv-3.2.0/work/opencv-3.2.0/modules/highgui/include/opencv2/highgui.hpp:46, from /var/tmp/portage/media-libs/opencv-3.2.0/work/opencv-3.2.0_build/modules/highgui/precomp.hpp:45: /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/cstdlib:75:25: fatal error: stdlib.h: No such file or directory #include_next <stdlib.h> ^ compilation terminated. make[2]: *** [modules/highgui/CMakeFiles/pch_Generate_opencv_highgui.dir/build.make:64: modules/highgui/precomp.hpp.gch/opencv_highgui_Gentoo.gch] Error 1 make[2]: Leaving directory '/var/tmp/portage/media-libs/opencv-3.2.0/work/opencv-3.2.0_build' make[1]: *** [CMakeFiles/Makefile2:2141: modules/highgui/CMakeFiles/pch_Generate_opencv_highgui.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... make[2]: Leaving directory '/var/tmp/portage/media-libs/opencv-3.2.0/work/opencv-3.2.0_build' make -f modules/core/CMakeFiles/opencv_core.dir/build.make modules/core/CMakeFiles/opencv_core.dir/build make[2]: Entering directory '/var/tmp/portage/media-libs/opencv-3.2.0/work/opencv-3.2.0_build' quad ~ # emerge -pqv '=media-libs/opencv-3.2.0::gentoo' [ebuild R ] media-libs/opencv-3.2.0 USE="eigen ffmpeg gstreamer gtk jpeg opengl openmp pch png python qt5 threads tiff v4l -contrib -contrib_cvv -contrib_hdf -contrib_sfm -contrib_xfeatures2d -cuda -debug -examples -gdal -gflags -glog -gphoto2 -ieee1394 (-ipp) -java -jpeg2k -lapack -libav -opencl -openexr -tesseract -testprograms -vaapi -vtk -webp -xine" PYTHON_TARGETS="python2_7 python3_4 -python3_5"
Created attachment 471812 [details] emerge_info
Disabling precompiled headers (USE="-pch") allows it to build for me. I found it on url I added to this bug report.
Could you please change the subject to include the error message? i.e. "/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/cstdlib:75:25: fatal error: stdlib.h: No such file or directory"
same problem here, using gcc 6.3.0 as well.
Fix for OpenCV 3.2: https://github.com/opencv/opencv/pull/6541 Backport for OpenCV 2.4: https://github.com/opencv/opencv/pull/6545
commit 4f5b990bd068f98184e7ecfabf461a33275569c5 Author: Amy Liffey <amynka@gentoo.org> Date: Tue Jun 6 16:42:31 2017 +0200 media-libs/opencv: disable pch for gcc-6.0 bug #617654 Should be disabled now. Thank you !