error linking stdlib.h when building OpenCV on a Chromebook












0















Configuration seems to run successfully...



cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
-- The CXX compiler identification is GNU 7.3.0

-- The C compiler identification is GNU 7.3.0
-- Check for working CXX compiler: /usr/local/bin/c++
-- Check for working CXX compiler: /usr/local/bin/c++ -- works


(etc)



then when I run make install,



chronos@localhost ~/Downloads/python/opencv-3.4.3/build $ sudo make install
Scanning dependencies of target gen-pkgconfig
[ 0%] Generate opencv.pc
[ 0%] Built target gen-pkgconfig
Scanning dependencies of target libjpeg-turbo
[ 0%] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jcapimin.c.o
[ 0%] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jcapistd.c.o`

(etc)

`[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_print.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_read.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_strip.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_swab.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_thunder.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_tile.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_version.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_warning.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_write.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_zip.c.o
[ 5%] Building CXX object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_stream.cxx.o
In file included from /usr/local/include/c++/7.3.0/ext/string_conversions.h:41:0,
from /usr/local/include/c++/7.3.0/bits/basic_string.h:6349,
from /usr/local/include/c++/7.3.0/string:52,
from /usr/local/include/c++/7.3.0/bits/locale_classes.h:40,
from /usr/local/include/c++/7.3.0/bits/ios_base.h:41,
from /usr/local/include/c++/7.3.0/ios:42,
from /usr/local/include/c++/7.3.0/ostream:38,
from /usr/local/include/c++/7.3.0/iostream:39,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/libtiff/tiffio.hxx:34,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/libtiff/tif_stream.cxx:31:
/usr/local/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
make[2]: *** [3rdparty/libtiff/CMakeFiles/libtiff.dir/build.make:557: 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_stream.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:387: 3rdparty/libtiff/CMakeFiles/libtiff.dir/all] Error 2
make: *** [Makefile:163: all] Error 2


I have tried disabling 3rd party libraries and it fails later on, with the same error for a different component.



chronos@localhost ~/Downloads/python/opencv-3.4.3/build $ sudo make install
[ 0%] Generate opencv.pc
[ 0%] Built target gen-pkgconfig
[ 9%] Built target libwebp
[ 11%] Built target libjasper
[ 13%] Built target libpng
[ 13%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/Half/half.cpp.o
In file included from /usr/local/include/c++/7.3.0/ext/string_conversions.h:41:0,
from /usr/local/include/c++/7.3.0/bits/basic_string.h:6349,
from /usr/local/include/c++/7.3.0/string:52,
from /usr/local/include/c++/7.3.0/bits/locale_classes.h:40,
from /usr/local/include/c++/7.3.0/bits/ios_base.h:41,
from /usr/local/include/c++/7.3.0/ios:42,
from /usr/local/include/c++/7.3.0/ostream:38,
from /usr/local/include/c++/7.3.0/iostream:39,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.h:88,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.cpp:48:
/usr/local/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.


Versions and library appear fine...



chronos@localhost ~/Downloads/python/opencv-3.4.3/build $ gcc --version
gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

chronos@localhost ~/Downloads/python/opencv-3.4.3/build $ sudo find / -type f -name "*stdlib.h"
/usr/local/include/stdlib.h
/usr/local/include/bits/stdlib.h
/usr/local/include/c++/7.3.0/stdlib.h
/usr/local/include/c++/7.3.0/tr1/stdlib.h
/mnt/stateful_partition/dev_image/include/stdlib.h
/mnt/stateful_partition/dev_image/include/bits/stdlib.h
/mnt/stateful_partition/dev_image/include/c++/7.3.0/stdlib.h
/mnt/stateful_partition/dev_image/include/c++/7.3.0/tr1/stdlib.h


with VERBOSE=1,



make -f 3rdparty/openexr/CMakeFiles/IlmImf.dir/build.make 3rdparty/openexr/CMakeFiles/IlmImf.dir/build
make[2]: Entering directory '/home/chronos/user/Downloads/python/opencv-3.4.3/build'
[ 12%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/Half/half.cpp.o
cd /home/chronos/user/Downloads/python/opencv-3.4.3/build/3rdparty/openexr && /usr/local/bin/c++ -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/IlmImf -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Imath -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/IlmThread -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Iex -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half -I/home/chronos/user/Downloads/python/opencv-3.4.3/build/3rdparty/openexr -I/home/chronos/user/Downloads/python/opencv-3.4.3/build -isystem /usr/local/include -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Winit-self -Wpointer-arith -Wsign-promo -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -Wno-shadow -Wno-unused -Wno-sign-compare -Wno-undef -Wno-missing-declarations -Wno-uninitialized -Wno-switch -Wno-parentheses -Wno-array-bounds -Wno-extra -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-deprecated -Wno-suggest-override -Wno-implicit-fallthrough -O3 -DNDEBUG -DNDEBUG -fPIC -o CMakeFiles/IlmImf.dir/Half/half.cpp.o -c /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.cpp
In file included from /usr/local/include/c++/7.3.0/ext/string_conversions.h:41:0,
from /usr/local/include/c++/7.3.0/bits/basic_string.h:6349,
from /usr/local/include/c++/7.3.0/string:52,
from /usr/local/include/c++/7.3.0/bits/locale_classes.h:40,
from /usr/local/include/c++/7.3.0/bits/ios_base.h:41,
from /usr/local/include/c++/7.3.0/ios:42,
from /usr/local/include/c++/7.3.0/ostream:38,
from /usr/local/include/c++/7.3.0/iostream:39,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.h:88,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.cpp:48:
/usr/local/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
make[2]: *** [3rdparty/openexr/CMakeFiles/IlmImf.dir/build.make:63: 3rdparty/openexr/CMakeFiles/IlmImf.dir/Half/half.cpp.o] Error 1
make[2]: Leaving directory '/home/chronos/user/Downloads/python/opencv-3.4.3/build'
make[1]: *** [CMakeFiles/Makefile2:442: 3rdparty/openexr/CMakeFiles/IlmImf.dir/all] Error 2
make[1]: Leaving directory '/home/chronos/user/Downloads/python/opencv-3.4.3/build'
make: *** [Makefile:163: all] Error 2









share|improve this question

























  • It would be interesting to check make VERBOSE=1 output - it will show exact command line used for compilation. BTW, I understand why do you use sudo for make install, but why do you use sudo for make too?

    – Tsyvarev
    Nov 13 '18 at 22:04











  • @Tsyvarev thanks, I will include that output. I think I only used sudo for make install (there are two outputs there) and the initial one, the cmake command, was run without sudo.

    – JAL
    Nov 14 '18 at 2:54











  • output with VERBOSE=1 added. Based on my research, this has something to do with the -isystem in the command, but I don't know enough about c++ to fix it.

    – JAL
    Nov 14 '18 at 2:57











  • Yes, according to other cases with similar error message, -isystem plays a role in that. There is CMakeCache.txt file in the build directory, does it contain a string /usr/local/include?

    – Tsyvarev
    Nov 14 '18 at 7:25











  • @Tsyvarev yes, there are many occurrences of that path in CMakeCache.txt.

    – JAL
    Nov 14 '18 at 14:28
















0















Configuration seems to run successfully...



cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
-- The CXX compiler identification is GNU 7.3.0

-- The C compiler identification is GNU 7.3.0
-- Check for working CXX compiler: /usr/local/bin/c++
-- Check for working CXX compiler: /usr/local/bin/c++ -- works


(etc)



then when I run make install,



chronos@localhost ~/Downloads/python/opencv-3.4.3/build $ sudo make install
Scanning dependencies of target gen-pkgconfig
[ 0%] Generate opencv.pc
[ 0%] Built target gen-pkgconfig
Scanning dependencies of target libjpeg-turbo
[ 0%] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jcapimin.c.o
[ 0%] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jcapistd.c.o`

(etc)

`[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_print.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_read.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_strip.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_swab.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_thunder.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_tile.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_version.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_warning.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_write.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_zip.c.o
[ 5%] Building CXX object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_stream.cxx.o
In file included from /usr/local/include/c++/7.3.0/ext/string_conversions.h:41:0,
from /usr/local/include/c++/7.3.0/bits/basic_string.h:6349,
from /usr/local/include/c++/7.3.0/string:52,
from /usr/local/include/c++/7.3.0/bits/locale_classes.h:40,
from /usr/local/include/c++/7.3.0/bits/ios_base.h:41,
from /usr/local/include/c++/7.3.0/ios:42,
from /usr/local/include/c++/7.3.0/ostream:38,
from /usr/local/include/c++/7.3.0/iostream:39,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/libtiff/tiffio.hxx:34,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/libtiff/tif_stream.cxx:31:
/usr/local/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
make[2]: *** [3rdparty/libtiff/CMakeFiles/libtiff.dir/build.make:557: 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_stream.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:387: 3rdparty/libtiff/CMakeFiles/libtiff.dir/all] Error 2
make: *** [Makefile:163: all] Error 2


I have tried disabling 3rd party libraries and it fails later on, with the same error for a different component.



chronos@localhost ~/Downloads/python/opencv-3.4.3/build $ sudo make install
[ 0%] Generate opencv.pc
[ 0%] Built target gen-pkgconfig
[ 9%] Built target libwebp
[ 11%] Built target libjasper
[ 13%] Built target libpng
[ 13%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/Half/half.cpp.o
In file included from /usr/local/include/c++/7.3.0/ext/string_conversions.h:41:0,
from /usr/local/include/c++/7.3.0/bits/basic_string.h:6349,
from /usr/local/include/c++/7.3.0/string:52,
from /usr/local/include/c++/7.3.0/bits/locale_classes.h:40,
from /usr/local/include/c++/7.3.0/bits/ios_base.h:41,
from /usr/local/include/c++/7.3.0/ios:42,
from /usr/local/include/c++/7.3.0/ostream:38,
from /usr/local/include/c++/7.3.0/iostream:39,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.h:88,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.cpp:48:
/usr/local/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.


Versions and library appear fine...



chronos@localhost ~/Downloads/python/opencv-3.4.3/build $ gcc --version
gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

chronos@localhost ~/Downloads/python/opencv-3.4.3/build $ sudo find / -type f -name "*stdlib.h"
/usr/local/include/stdlib.h
/usr/local/include/bits/stdlib.h
/usr/local/include/c++/7.3.0/stdlib.h
/usr/local/include/c++/7.3.0/tr1/stdlib.h
/mnt/stateful_partition/dev_image/include/stdlib.h
/mnt/stateful_partition/dev_image/include/bits/stdlib.h
/mnt/stateful_partition/dev_image/include/c++/7.3.0/stdlib.h
/mnt/stateful_partition/dev_image/include/c++/7.3.0/tr1/stdlib.h


with VERBOSE=1,



make -f 3rdparty/openexr/CMakeFiles/IlmImf.dir/build.make 3rdparty/openexr/CMakeFiles/IlmImf.dir/build
make[2]: Entering directory '/home/chronos/user/Downloads/python/opencv-3.4.3/build'
[ 12%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/Half/half.cpp.o
cd /home/chronos/user/Downloads/python/opencv-3.4.3/build/3rdparty/openexr && /usr/local/bin/c++ -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/IlmImf -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Imath -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/IlmThread -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Iex -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half -I/home/chronos/user/Downloads/python/opencv-3.4.3/build/3rdparty/openexr -I/home/chronos/user/Downloads/python/opencv-3.4.3/build -isystem /usr/local/include -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Winit-self -Wpointer-arith -Wsign-promo -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -Wno-shadow -Wno-unused -Wno-sign-compare -Wno-undef -Wno-missing-declarations -Wno-uninitialized -Wno-switch -Wno-parentheses -Wno-array-bounds -Wno-extra -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-deprecated -Wno-suggest-override -Wno-implicit-fallthrough -O3 -DNDEBUG -DNDEBUG -fPIC -o CMakeFiles/IlmImf.dir/Half/half.cpp.o -c /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.cpp
In file included from /usr/local/include/c++/7.3.0/ext/string_conversions.h:41:0,
from /usr/local/include/c++/7.3.0/bits/basic_string.h:6349,
from /usr/local/include/c++/7.3.0/string:52,
from /usr/local/include/c++/7.3.0/bits/locale_classes.h:40,
from /usr/local/include/c++/7.3.0/bits/ios_base.h:41,
from /usr/local/include/c++/7.3.0/ios:42,
from /usr/local/include/c++/7.3.0/ostream:38,
from /usr/local/include/c++/7.3.0/iostream:39,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.h:88,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.cpp:48:
/usr/local/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
make[2]: *** [3rdparty/openexr/CMakeFiles/IlmImf.dir/build.make:63: 3rdparty/openexr/CMakeFiles/IlmImf.dir/Half/half.cpp.o] Error 1
make[2]: Leaving directory '/home/chronos/user/Downloads/python/opencv-3.4.3/build'
make[1]: *** [CMakeFiles/Makefile2:442: 3rdparty/openexr/CMakeFiles/IlmImf.dir/all] Error 2
make[1]: Leaving directory '/home/chronos/user/Downloads/python/opencv-3.4.3/build'
make: *** [Makefile:163: all] Error 2









share|improve this question

























  • It would be interesting to check make VERBOSE=1 output - it will show exact command line used for compilation. BTW, I understand why do you use sudo for make install, but why do you use sudo for make too?

    – Tsyvarev
    Nov 13 '18 at 22:04











  • @Tsyvarev thanks, I will include that output. I think I only used sudo for make install (there are two outputs there) and the initial one, the cmake command, was run without sudo.

    – JAL
    Nov 14 '18 at 2:54











  • output with VERBOSE=1 added. Based on my research, this has something to do with the -isystem in the command, but I don't know enough about c++ to fix it.

    – JAL
    Nov 14 '18 at 2:57











  • Yes, according to other cases with similar error message, -isystem plays a role in that. There is CMakeCache.txt file in the build directory, does it contain a string /usr/local/include?

    – Tsyvarev
    Nov 14 '18 at 7:25











  • @Tsyvarev yes, there are many occurrences of that path in CMakeCache.txt.

    – JAL
    Nov 14 '18 at 14:28














0












0








0








Configuration seems to run successfully...



cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
-- The CXX compiler identification is GNU 7.3.0

-- The C compiler identification is GNU 7.3.0
-- Check for working CXX compiler: /usr/local/bin/c++
-- Check for working CXX compiler: /usr/local/bin/c++ -- works


(etc)



then when I run make install,



chronos@localhost ~/Downloads/python/opencv-3.4.3/build $ sudo make install
Scanning dependencies of target gen-pkgconfig
[ 0%] Generate opencv.pc
[ 0%] Built target gen-pkgconfig
Scanning dependencies of target libjpeg-turbo
[ 0%] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jcapimin.c.o
[ 0%] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jcapistd.c.o`

(etc)

`[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_print.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_read.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_strip.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_swab.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_thunder.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_tile.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_version.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_warning.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_write.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_zip.c.o
[ 5%] Building CXX object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_stream.cxx.o
In file included from /usr/local/include/c++/7.3.0/ext/string_conversions.h:41:0,
from /usr/local/include/c++/7.3.0/bits/basic_string.h:6349,
from /usr/local/include/c++/7.3.0/string:52,
from /usr/local/include/c++/7.3.0/bits/locale_classes.h:40,
from /usr/local/include/c++/7.3.0/bits/ios_base.h:41,
from /usr/local/include/c++/7.3.0/ios:42,
from /usr/local/include/c++/7.3.0/ostream:38,
from /usr/local/include/c++/7.3.0/iostream:39,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/libtiff/tiffio.hxx:34,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/libtiff/tif_stream.cxx:31:
/usr/local/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
make[2]: *** [3rdparty/libtiff/CMakeFiles/libtiff.dir/build.make:557: 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_stream.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:387: 3rdparty/libtiff/CMakeFiles/libtiff.dir/all] Error 2
make: *** [Makefile:163: all] Error 2


I have tried disabling 3rd party libraries and it fails later on, with the same error for a different component.



chronos@localhost ~/Downloads/python/opencv-3.4.3/build $ sudo make install
[ 0%] Generate opencv.pc
[ 0%] Built target gen-pkgconfig
[ 9%] Built target libwebp
[ 11%] Built target libjasper
[ 13%] Built target libpng
[ 13%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/Half/half.cpp.o
In file included from /usr/local/include/c++/7.3.0/ext/string_conversions.h:41:0,
from /usr/local/include/c++/7.3.0/bits/basic_string.h:6349,
from /usr/local/include/c++/7.3.0/string:52,
from /usr/local/include/c++/7.3.0/bits/locale_classes.h:40,
from /usr/local/include/c++/7.3.0/bits/ios_base.h:41,
from /usr/local/include/c++/7.3.0/ios:42,
from /usr/local/include/c++/7.3.0/ostream:38,
from /usr/local/include/c++/7.3.0/iostream:39,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.h:88,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.cpp:48:
/usr/local/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.


Versions and library appear fine...



chronos@localhost ~/Downloads/python/opencv-3.4.3/build $ gcc --version
gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

chronos@localhost ~/Downloads/python/opencv-3.4.3/build $ sudo find / -type f -name "*stdlib.h"
/usr/local/include/stdlib.h
/usr/local/include/bits/stdlib.h
/usr/local/include/c++/7.3.0/stdlib.h
/usr/local/include/c++/7.3.0/tr1/stdlib.h
/mnt/stateful_partition/dev_image/include/stdlib.h
/mnt/stateful_partition/dev_image/include/bits/stdlib.h
/mnt/stateful_partition/dev_image/include/c++/7.3.0/stdlib.h
/mnt/stateful_partition/dev_image/include/c++/7.3.0/tr1/stdlib.h


with VERBOSE=1,



make -f 3rdparty/openexr/CMakeFiles/IlmImf.dir/build.make 3rdparty/openexr/CMakeFiles/IlmImf.dir/build
make[2]: Entering directory '/home/chronos/user/Downloads/python/opencv-3.4.3/build'
[ 12%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/Half/half.cpp.o
cd /home/chronos/user/Downloads/python/opencv-3.4.3/build/3rdparty/openexr && /usr/local/bin/c++ -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/IlmImf -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Imath -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/IlmThread -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Iex -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half -I/home/chronos/user/Downloads/python/opencv-3.4.3/build/3rdparty/openexr -I/home/chronos/user/Downloads/python/opencv-3.4.3/build -isystem /usr/local/include -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Winit-self -Wpointer-arith -Wsign-promo -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -Wno-shadow -Wno-unused -Wno-sign-compare -Wno-undef -Wno-missing-declarations -Wno-uninitialized -Wno-switch -Wno-parentheses -Wno-array-bounds -Wno-extra -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-deprecated -Wno-suggest-override -Wno-implicit-fallthrough -O3 -DNDEBUG -DNDEBUG -fPIC -o CMakeFiles/IlmImf.dir/Half/half.cpp.o -c /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.cpp
In file included from /usr/local/include/c++/7.3.0/ext/string_conversions.h:41:0,
from /usr/local/include/c++/7.3.0/bits/basic_string.h:6349,
from /usr/local/include/c++/7.3.0/string:52,
from /usr/local/include/c++/7.3.0/bits/locale_classes.h:40,
from /usr/local/include/c++/7.3.0/bits/ios_base.h:41,
from /usr/local/include/c++/7.3.0/ios:42,
from /usr/local/include/c++/7.3.0/ostream:38,
from /usr/local/include/c++/7.3.0/iostream:39,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.h:88,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.cpp:48:
/usr/local/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
make[2]: *** [3rdparty/openexr/CMakeFiles/IlmImf.dir/build.make:63: 3rdparty/openexr/CMakeFiles/IlmImf.dir/Half/half.cpp.o] Error 1
make[2]: Leaving directory '/home/chronos/user/Downloads/python/opencv-3.4.3/build'
make[1]: *** [CMakeFiles/Makefile2:442: 3rdparty/openexr/CMakeFiles/IlmImf.dir/all] Error 2
make[1]: Leaving directory '/home/chronos/user/Downloads/python/opencv-3.4.3/build'
make: *** [Makefile:163: all] Error 2









share|improve this question
















Configuration seems to run successfully...



cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
-- The CXX compiler identification is GNU 7.3.0

-- The C compiler identification is GNU 7.3.0
-- Check for working CXX compiler: /usr/local/bin/c++
-- Check for working CXX compiler: /usr/local/bin/c++ -- works


(etc)



then when I run make install,



chronos@localhost ~/Downloads/python/opencv-3.4.3/build $ sudo make install
Scanning dependencies of target gen-pkgconfig
[ 0%] Generate opencv.pc
[ 0%] Built target gen-pkgconfig
Scanning dependencies of target libjpeg-turbo
[ 0%] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jcapimin.c.o
[ 0%] Building C object 3rdparty/libjpeg-turbo/CMakeFiles/libjpeg-turbo.dir/src/jcapistd.c.o`

(etc)

`[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_print.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_read.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_strip.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_swab.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_thunder.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_tile.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_version.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_warning.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_write.c.o
[ 5%] Building C object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_zip.c.o
[ 5%] Building CXX object 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_stream.cxx.o
In file included from /usr/local/include/c++/7.3.0/ext/string_conversions.h:41:0,
from /usr/local/include/c++/7.3.0/bits/basic_string.h:6349,
from /usr/local/include/c++/7.3.0/string:52,
from /usr/local/include/c++/7.3.0/bits/locale_classes.h:40,
from /usr/local/include/c++/7.3.0/bits/ios_base.h:41,
from /usr/local/include/c++/7.3.0/ios:42,
from /usr/local/include/c++/7.3.0/ostream:38,
from /usr/local/include/c++/7.3.0/iostream:39,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/libtiff/tiffio.hxx:34,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/libtiff/tif_stream.cxx:31:
/usr/local/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
make[2]: *** [3rdparty/libtiff/CMakeFiles/libtiff.dir/build.make:557: 3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_stream.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:387: 3rdparty/libtiff/CMakeFiles/libtiff.dir/all] Error 2
make: *** [Makefile:163: all] Error 2


I have tried disabling 3rd party libraries and it fails later on, with the same error for a different component.



chronos@localhost ~/Downloads/python/opencv-3.4.3/build $ sudo make install
[ 0%] Generate opencv.pc
[ 0%] Built target gen-pkgconfig
[ 9%] Built target libwebp
[ 11%] Built target libjasper
[ 13%] Built target libpng
[ 13%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/Half/half.cpp.o
In file included from /usr/local/include/c++/7.3.0/ext/string_conversions.h:41:0,
from /usr/local/include/c++/7.3.0/bits/basic_string.h:6349,
from /usr/local/include/c++/7.3.0/string:52,
from /usr/local/include/c++/7.3.0/bits/locale_classes.h:40,
from /usr/local/include/c++/7.3.0/bits/ios_base.h:41,
from /usr/local/include/c++/7.3.0/ios:42,
from /usr/local/include/c++/7.3.0/ostream:38,
from /usr/local/include/c++/7.3.0/iostream:39,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.h:88,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.cpp:48:
/usr/local/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.


Versions and library appear fine...



chronos@localhost ~/Downloads/python/opencv-3.4.3/build $ gcc --version
gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

chronos@localhost ~/Downloads/python/opencv-3.4.3/build $ sudo find / -type f -name "*stdlib.h"
/usr/local/include/stdlib.h
/usr/local/include/bits/stdlib.h
/usr/local/include/c++/7.3.0/stdlib.h
/usr/local/include/c++/7.3.0/tr1/stdlib.h
/mnt/stateful_partition/dev_image/include/stdlib.h
/mnt/stateful_partition/dev_image/include/bits/stdlib.h
/mnt/stateful_partition/dev_image/include/c++/7.3.0/stdlib.h
/mnt/stateful_partition/dev_image/include/c++/7.3.0/tr1/stdlib.h


with VERBOSE=1,



make -f 3rdparty/openexr/CMakeFiles/IlmImf.dir/build.make 3rdparty/openexr/CMakeFiles/IlmImf.dir/build
make[2]: Entering directory '/home/chronos/user/Downloads/python/opencv-3.4.3/build'
[ 12%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/Half/half.cpp.o
cd /home/chronos/user/Downloads/python/opencv-3.4.3/build/3rdparty/openexr && /usr/local/bin/c++ -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/IlmImf -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Imath -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/IlmThread -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Iex -I/home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half -I/home/chronos/user/Downloads/python/opencv-3.4.3/build/3rdparty/openexr -I/home/chronos/user/Downloads/python/opencv-3.4.3/build -isystem /usr/local/include -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Winit-self -Wpointer-arith -Wsign-promo -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -Wno-shadow -Wno-unused -Wno-sign-compare -Wno-undef -Wno-missing-declarations -Wno-uninitialized -Wno-switch -Wno-parentheses -Wno-array-bounds -Wno-extra -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-deprecated -Wno-suggest-override -Wno-implicit-fallthrough -O3 -DNDEBUG -DNDEBUG -fPIC -o CMakeFiles/IlmImf.dir/Half/half.cpp.o -c /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.cpp
In file included from /usr/local/include/c++/7.3.0/ext/string_conversions.h:41:0,
from /usr/local/include/c++/7.3.0/bits/basic_string.h:6349,
from /usr/local/include/c++/7.3.0/string:52,
from /usr/local/include/c++/7.3.0/bits/locale_classes.h:40,
from /usr/local/include/c++/7.3.0/bits/ios_base.h:41,
from /usr/local/include/c++/7.3.0/ios:42,
from /usr/local/include/c++/7.3.0/ostream:38,
from /usr/local/include/c++/7.3.0/iostream:39,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.h:88,
from /home/chronos/user/Downloads/python/opencv-3.4.3/3rdparty/openexr/Half/half.cpp:48:
/usr/local/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
make[2]: *** [3rdparty/openexr/CMakeFiles/IlmImf.dir/build.make:63: 3rdparty/openexr/CMakeFiles/IlmImf.dir/Half/half.cpp.o] Error 1
make[2]: Leaving directory '/home/chronos/user/Downloads/python/opencv-3.4.3/build'
make[1]: *** [CMakeFiles/Makefile2:442: 3rdparty/openexr/CMakeFiles/IlmImf.dir/all] Error 2
make[1]: Leaving directory '/home/chronos/user/Downloads/python/opencv-3.4.3/build'
make: *** [Makefile:163: all] Error 2






c++ opencv cmake configure google-chrome-os






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 2:57







JAL

















asked Nov 13 '18 at 21:08









JALJAL

17.6k13759




17.6k13759













  • It would be interesting to check make VERBOSE=1 output - it will show exact command line used for compilation. BTW, I understand why do you use sudo for make install, but why do you use sudo for make too?

    – Tsyvarev
    Nov 13 '18 at 22:04











  • @Tsyvarev thanks, I will include that output. I think I only used sudo for make install (there are two outputs there) and the initial one, the cmake command, was run without sudo.

    – JAL
    Nov 14 '18 at 2:54











  • output with VERBOSE=1 added. Based on my research, this has something to do with the -isystem in the command, but I don't know enough about c++ to fix it.

    – JAL
    Nov 14 '18 at 2:57











  • Yes, according to other cases with similar error message, -isystem plays a role in that. There is CMakeCache.txt file in the build directory, does it contain a string /usr/local/include?

    – Tsyvarev
    Nov 14 '18 at 7:25











  • @Tsyvarev yes, there are many occurrences of that path in CMakeCache.txt.

    – JAL
    Nov 14 '18 at 14:28



















  • It would be interesting to check make VERBOSE=1 output - it will show exact command line used for compilation. BTW, I understand why do you use sudo for make install, but why do you use sudo for make too?

    – Tsyvarev
    Nov 13 '18 at 22:04











  • @Tsyvarev thanks, I will include that output. I think I only used sudo for make install (there are two outputs there) and the initial one, the cmake command, was run without sudo.

    – JAL
    Nov 14 '18 at 2:54











  • output with VERBOSE=1 added. Based on my research, this has something to do with the -isystem in the command, but I don't know enough about c++ to fix it.

    – JAL
    Nov 14 '18 at 2:57











  • Yes, according to other cases with similar error message, -isystem plays a role in that. There is CMakeCache.txt file in the build directory, does it contain a string /usr/local/include?

    – Tsyvarev
    Nov 14 '18 at 7:25











  • @Tsyvarev yes, there are many occurrences of that path in CMakeCache.txt.

    – JAL
    Nov 14 '18 at 14:28

















It would be interesting to check make VERBOSE=1 output - it will show exact command line used for compilation. BTW, I understand why do you use sudo for make install, but why do you use sudo for make too?

– Tsyvarev
Nov 13 '18 at 22:04





It would be interesting to check make VERBOSE=1 output - it will show exact command line used for compilation. BTW, I understand why do you use sudo for make install, but why do you use sudo for make too?

– Tsyvarev
Nov 13 '18 at 22:04













@Tsyvarev thanks, I will include that output. I think I only used sudo for make install (there are two outputs there) and the initial one, the cmake command, was run without sudo.

– JAL
Nov 14 '18 at 2:54





@Tsyvarev thanks, I will include that output. I think I only used sudo for make install (there are two outputs there) and the initial one, the cmake command, was run without sudo.

– JAL
Nov 14 '18 at 2:54













output with VERBOSE=1 added. Based on my research, this has something to do with the -isystem in the command, but I don't know enough about c++ to fix it.

– JAL
Nov 14 '18 at 2:57





output with VERBOSE=1 added. Based on my research, this has something to do with the -isystem in the command, but I don't know enough about c++ to fix it.

– JAL
Nov 14 '18 at 2:57













Yes, according to other cases with similar error message, -isystem plays a role in that. There is CMakeCache.txt file in the build directory, does it contain a string /usr/local/include?

– Tsyvarev
Nov 14 '18 at 7:25





Yes, according to other cases with similar error message, -isystem plays a role in that. There is CMakeCache.txt file in the build directory, does it contain a string /usr/local/include?

– Tsyvarev
Nov 14 '18 at 7:25













@Tsyvarev yes, there are many occurrences of that path in CMakeCache.txt.

– JAL
Nov 14 '18 at 14:28





@Tsyvarev yes, there are many occurrences of that path in CMakeCache.txt.

– JAL
Nov 14 '18 at 14:28












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53289516%2ferror-linking-stdlib-h-when-building-opencv-on-a-chromebook%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53289516%2ferror-linking-stdlib-h-when-building-opencv-on-a-chromebook%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Xamarin.form Move up view when keyboard appear

JBPM : POST request for execute process go wrong