Skip to content

fatal error: stdlib.h: No such file or directory #514

Closed

Description

@CvH

Starting with that commit 18c36bb I get that error while building - I am not too sure if I am doing something wrong (missing parameter or something). Current master has still the same problem. Maybe someone can hint me a solution.
I manually removed list(APPEND CMAKE_CXX_FLAGS "-Wall -Wextra") to get that error (that was already fixed at master).

buildbot:~/Git/LE$ PROJECT=Generic ARCH=x86_64 scripts/build encfs
  BUILD    encfs (target)
      TOOLCHAIN    cmake (auto-detect)
Executing (target): cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_TOOLCHAIN_FILE=/builddir/toolchain/etc/cmake-x86_64-libreelec-linux-gnu.conf -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_UNIT_TESTS=OFF -DCMAKE_TOOLCHAIN_FILE=/builddir/toolchain/etc/cmake-x86_64-libreelec-linux-gnu.conf /builddir/encfs-18c36bb
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /builddir/toolchain/bin/x86_64-libreelec-linux-gnu-gcc
-- Check for working C compiler: /builddir/toolchain/bin/x86_64-libreelec-linux-gnu-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /builddir/toolchain/bin/x86_64-libreelec-linux-gnu-g++
-- Check for working CXX compiler: /builddir/toolchain/bin/x86_64-libreelec-linux-gnu-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found FUSE: /builddir/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/fuse  
-- Found OpenSSL: /builddir/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/lib/libcrypto.so (found version "1.0.2o") 
-- Looking for C++ include attr/xattr.h
-- Looking for C++ include attr/xattr.h - not found
-- Looking for C++ include sys/xattr.h
-- Looking for C++ include sys/xattr.h - found
-- Performing Test HAVE_DIRENT_D_TYPE
-- Performing Test HAVE_DIRENT_D_TYPE - Success
-- Performing Test XATTR_ADD_OPT
-- Performing Test XATTR_ADD_OPT - Failed
-- Performing Test COMPILER_NEEDS_LATOMIC
-- Performing Test COMPILER_NEEDS_LATOMIC - Failed
-- Performing Test LINKER_SUPPORTS_WLASNEEDED
-- Performing Test LINKER_SUPPORTS_WLASNEEDED - Success
-- Looking for utimensat
-- Looking for utimensat - found
-- Looking for fdatasync
-- Looking for fdatasync - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Looking for C++ include syslog.h
-- Looking for C++ include syslog.h - found
-- Enabled syslog logging support
-- Found Intl: /builddir/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include  
-- Found Gettext: /builddir/toolchain/bin/msgmerge (found version "0.19.8.1") 
-- clang-tidy check skipped, need newer cmake
-- Using vendored TinyXML2
-- Using vendored easylogging++
-- Setting C++11
-- Configuring done
-- Generating done
-- Build files have been written to: /builddir/encfs-18c36bb/.x86_64-libreelec-linux-gnu
Executing (target): ninja 
[1/94] Building CXX object CMakeFiles/encfs.dir/encfs/base64.cpp.o
FAILED: CMakeFiles/encfs.dir/encfs/base64.cpp.o 
/builddir/toolchain/bin/x86_64-libreelec-linux-gnu-g++  -DELPP_DISABLE_DEFAULT_CRASH_HANDLING -DELPP_NO_DEFAULT_LOG_FILE -DELPP_SYSLOG -DELPP_THREAD_SAFE -DENABLE_NLS -DFUSE_USE_VERSION=26 -DLOCALEDIR=\"/usr/share/locale\" -DPACKAGE=\"encfs\" -D_CRT_SECURE_NO_WARNINGS -D_FILE_OFFSET_BITS=64 -isystem /builddir/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/fuse -isystem /builddir/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include -I. -I../ -isystem ../vendor/github.com/leethomason/tinyxml2 -isystem ../vendor/github.com/muflihun/easyloggingpp/src -march=x86-64 -m64 -fomit-frame-pointer -Wall -pipe -Os -mmmx -msse -msse2 -mfpmath=sse -flto -ffat-lto-objects -Os -DNDEBUG   -std=gnu++11 -MD -MT CMakeFiles/encfs.dir/encfs/base64.cpp.o -MF CMakeFiles/encfs.dir/encfs/base64.cpp.o.d -o CMakeFiles/encfs.dir/encfs/base64.cpp.o -c ../encfs/base64.cpp
In file included from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/ext/string_conversions.h:41:0,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/bits/basic_string.h:6349,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/string:52,
                 from ../encfs/base64.h:24,
                 from ../encfs/base64.cpp:21:
/builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
[2/94] Building CXX object CMakeFiles/encfs.dir/encfs/BlockNameIO.cpp.o
FAILED: CMakeFiles/encfs.dir/encfs/BlockNameIO.cpp.o 
/builddir/toolchain/bin/x86_64-libreelec-linux-gnu-g++  -DELPP_DISABLE_DEFAULT_CRASH_HANDLING -DELPP_NO_DEFAULT_LOG_FILE -DELPP_SYSLOG -DELPP_THREAD_SAFE -DENABLE_NLS -DFUSE_USE_VERSION=26 -DLOCALEDIR=\"/usr/share/locale\" -DPACKAGE=\"encfs\" -D_CRT_SECURE_NO_WARNINGS -D_FILE_OFFSET_BITS=64 -isystem /builddir/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/fuse -isystem /builddir/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include -I. -I../ -isystem ../vendor/github.com/leethomason/tinyxml2 -isystem ../vendor/github.com/muflihun/easyloggingpp/src -march=x86-64 -m64 -fomit-frame-pointer -Wall -pipe -Os -mmmx -msse -msse2 -mfpmath=sse -flto -ffat-lto-objects -Os -DNDEBUG   -std=gnu++11 -MD -MT CMakeFiles/encfs.dir/encfs/BlockNameIO.cpp.o -MF CMakeFiles/encfs.dir/encfs/BlockNameIO.cpp.o.d -o CMakeFiles/encfs.dir/encfs/BlockNameIO.cpp.o -c ../encfs/BlockNameIO.cpp
In file included from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/ext/string_conversions.h:41:0,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/bits/basic_string.h:6349,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/string:52,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/stdexcept:39,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/array:39,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/tuple:39,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/bits/unique_ptr.h:37,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/memory:80,
                 from ../encfs/BlockNameIO.h:24,
                 from ../encfs/BlockNameIO.cpp:21:
/builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
[3/94] Building CXX object CMakeFiles/encfs.dir/encfs/BlockFileIO.cpp.o
FAILED: CMakeFiles/encfs.dir/encfs/BlockFileIO.cpp.o 
/builddir/toolchain/bin/x86_64-libreelec-linux-gnu-g++  -DELPP_DISABLE_DEFAULT_CRASH_HANDLING -DELPP_NO_DEFAULT_LOG_FILE -DELPP_SYSLOG -DELPP_THREAD_SAFE -DENABLE_NLS -DFUSE_USE_VERSION=26 -DLOCALEDIR=\"/usr/share/locale\" -DPACKAGE=\"encfs\" -D_CRT_SECURE_NO_WARNINGS -D_FILE_OFFSET_BITS=64 -isystem /builddir/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/fuse -isystem /builddir/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include -I. -I../ -isystem ../vendor/github.com/leethomason/tinyxml2 -isystem ../vendor/github.com/muflihun/easyloggingpp/src -march=x86-64 -m64 -fomit-frame-pointer -Wall -pipe -Os -mmmx -msse -msse2 -mfpmath=sse -flto -ffat-lto-objects -Os -DNDEBUG   -std=gnu++11 -MD -MT CMakeFiles/encfs.dir/encfs/BlockFileIO.cpp.o -MF CMakeFiles/encfs.dir/encfs/BlockFileIO.cpp.o.d -o CMakeFiles/encfs.dir/encfs/BlockFileIO.cpp.o -c ../encfs/BlockFileIO.cpp
In file included from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/ext/string_conversions.h:41:0,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/bits/basic_string.h:6349,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/string:52,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/stdexcept:39,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/array:39,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/tuple:39,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/bits/unique_ptr.h:37,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/memory:80,
                 from ../encfs/FSConfig.h:24,
                 from ../encfs/BlockFileIO.h:26,
                 from ../encfs/BlockFileIO.cpp:21:
/builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
[4/94] Building CXX object CMakeFiles/encfs.dir/encfs/Cipher.cpp.o
FAILED: CMakeFiles/encfs.dir/encfs/Cipher.cpp.o 
/builddir/toolchain/bin/x86_64-libreelec-linux-gnu-g++  -DELPP_DISABLE_DEFAULT_CRASH_HANDLING -DELPP_NO_DEFAULT_LOG_FILE -DELPP_SYSLOG -DELPP_THREAD_SAFE -DENABLE_NLS -DFUSE_USE_VERSION=26 -DLOCALEDIR=\"/usr/share/locale\" -DPACKAGE=\"encfs\" -D_CRT_SECURE_NO_WARNINGS -D_FILE_OFFSET_BITS=64 -isystem /builddir/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/fuse -isystem /builddir/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include -I. -I../ -isystem ../vendor/github.com/leethomason/tinyxml2 -isystem ../vendor/github.com/muflihun/easyloggingpp/src -march=x86-64 -m64 -fomit-frame-pointer -Wall -pipe -Os -mmmx -msse -msse2 -mfpmath=sse -flto -ffat-lto-objects -Os -DNDEBUG   -std=gnu++11 -MD -MT CMakeFiles/encfs.dir/encfs/Cipher.cpp.o -MF CMakeFiles/encfs.dir/encfs/Cipher.cpp.o.d -o CMakeFiles/encfs.dir/encfs/Cipher.cpp.o -c ../encfs/Cipher.cpp
In file included from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/ext/string_conversions.h:41:0,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/bits/basic_string.h:6349,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/string:52,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/bits/locale_classes.h:40,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/bits/ios_base.h:41,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/ios:42,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/ostream:38,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/iostream:39,
                 from ../encfs/Cipher.cpp:22:
/builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
[5/94] Building CXX object CMakeFiles/encfs.dir/encfs/autosprintf.cpp.o
FAILED: CMakeFiles/encfs.dir/encfs/autosprintf.cpp.o 
/builddir/toolchain/bin/x86_64-libreelec-linux-gnu-g++  -DELPP_DISABLE_DEFAULT_CRASH_HANDLING -DELPP_NO_DEFAULT_LOG_FILE -DELPP_SYSLOG -DELPP_THREAD_SAFE -DENABLE_NLS -DFUSE_USE_VERSION=26 -DLOCALEDIR=\"/usr/share/locale\" -DPACKAGE=\"encfs\" -D_CRT_SECURE_NO_WARNINGS -D_FILE_OFFSET_BITS=64 -isystem /builddir/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/fuse -isystem /builddir/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include -I. -I../ -isystem ../vendor/github.com/leethomason/tinyxml2 -isystem ../vendor/github.com/muflihun/easyloggingpp/src -march=x86-64 -m64 -fomit-frame-pointer -Wall -pipe -Os -mmmx -msse -msse2 -mfpmath=sse -flto -ffat-lto-objects -Os -DNDEBUG   -std=gnu++11 -MD -MT CMakeFiles/encfs.dir/encfs/autosprintf.cpp.o -MF CMakeFiles/encfs.dir/encfs/autosprintf.cpp.o.d -o CMakeFiles/encfs.dir/encfs/autosprintf.cpp.o -c ../encfs/autosprintf.cpp
In file included from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/ext/string_conversions.h:41:0,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/bits/basic_string.h:6349,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/string:52,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/bits/locale_classes.h:40,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/bits/ios_base.h:41,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/ios:42,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/ostream:38,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/iostream:39,
                 from ../encfs/autosprintf.h:35,
                 from ../encfs/autosprintf.cpp:28:
/builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
[6/94] Building CXX object CMakeFiles/encfs.dir/encfs/CipherFileIO.cpp.o
FAILED: CMakeFiles/encfs.dir/encfs/CipherFileIO.cpp.o 
/builddir/toolchain/bin/x86_64-libreelec-linux-gnu-g++  -DELPP_DISABLE_DEFAULT_CRASH_HANDLING -DELPP_NO_DEFAULT_LOG_FILE -DELPP_SYSLOG -DELPP_THREAD_SAFE -DENABLE_NLS -DFUSE_USE_VERSION=26 -DLOCALEDIR=\"/usr/share/locale\" -DPACKAGE=\"encfs\" -D_CRT_SECURE_NO_WARNINGS -D_FILE_OFFSET_BITS=64 -isystem /builddir/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/fuse -isystem /builddir/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include -I. -I../ -isystem ../vendor/github.com/leethomason/tinyxml2 -isystem ../vendor/github.com/muflihun/easyloggingpp/src -march=x86-64 -m64 -fomit-frame-pointer -Wall -pipe -Os -mmmx -msse -msse2 -mfpmath=sse -flto -ffat-lto-objects -Os -DNDEBUG   -std=gnu++11 -MD -MT CMakeFiles/encfs.dir/encfs/CipherFileIO.cpp.o -MF CMakeFiles/encfs.dir/encfs/CipherFileIO.cpp.o.d -o CMakeFiles/encfs.dir/encfs/CipherFileIO.cpp.o -c ../encfs/CipherFileIO.cpp
In file included from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/ext/string_conversions.h:41:0,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/bits/basic_string.h:6349,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/string:52,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/stdexcept:39,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/array:39,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/tuple:39,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/bits/unique_ptr.h:37,
                 from /builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/memory:80,
                 from ../encfs/CipherFileIO.h:25,
                 from ../encfs/CipherFileIO.cpp:21:
/builddir/toolchain/x86_64-libreelec-linux-gnu/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.

Activity

  1. CvH commented on Apr 26, 2018

    @CvH
    Author

    -DCMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES=$SYSROOT_PREFIX/usr/include
    fixed it - not sure if bug or feature :)

  2. benrubson commented on Apr 26, 2018

    @benrubson
    Contributor

    Perhaps this error due to the fact you use a specific toolchain to build ?

    if you revert commit 18c36bb from current master, issue is solved ?
    Then, is the problem the -Wall -Wextra flags, or the SYSTEM keywords ?

  3. CvH commented on Apr 26, 2018

    @CvH
    Author

    My revert https://github.com/CvH/encfs/commit/4ee96d47f5149ac72c61158c7c1dcff69f748f20
    worked at master for me (or the -DCMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES workaround)

    is the problem the -Wall -Wextra flags

    -Wall -Wextra was broken too with that commit (18c36bb), but that was fixed later at some commit and works for me.

    Perhaps this error due to the fact you use a specific toolchain to build ?

    That is very likely but adding SYSTEM triggered the problem for us - my cmake knowledge is rather limited so no idea if this is a bug or not.

  4. benrubson commented on Apr 26, 2018

    @benrubson
    Contributor

    Googling the issue, seems quite "common", and your workaround seems to be the one to use.
    I don't know which Cmake version you use, but did you perhaps try with another / newer version ?

  5. CvH commented on Apr 26, 2018

    @CvH
    Author

    We use 3.10.x so nothing old, I can live with that workaround - if it considered "normal" just close the issue. Tx for help.

  6. benrubson commented on Apr 26, 2018

    @benrubson
    Contributor

    OK thank you @CvH.
    I'll have to build EncFS using some toolchains in (I hope) a few weeks, I'll see if I encounter the same issue 👍

  7. ankurshah963 commented on Sep 25, 2019

    @ankurshah963

    hii

    follow this code for resolve problem

    cd opencv-2.4.9

    cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_PERF_TESTS=OFF -DBUILD_opencv_gpu=OFF -DBUILD_opencv_ocl=OFF

    cmake -DENABLE_PRECOMPILED_HEADERS=OFF

    make

    =====================

    i hope your problem solve it.

    thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions