LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 04-06-2018, 08:00 AM   #1
percy_vere_uk
Member
 
Registered: Oct 2008
Location: Dorset, UK
Distribution: Arch, Lfs, Gentoo, Debian, Slackware
Posts: 98

Rep: Reputation: 12
stdlib.h: No such file or directory


Hi

I am using lfscript and have installed the base system without noticing any errors. But when I try to build gnutls I get the following:

Code:
/usr/include/c++/6.3.0/cstdlib:75:25: fatal error: stdlib.h: No such file or directory  #include_next <stdlib.h> ]]]
 #include_next <stdlib.h>
                         ^
compilation terminated.
make[3]: *** [Makefile:1710: ex-cxx.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/sources/builddir/gnutls-3.5.11/doc/examples'
make[2]: *** [Makefile:3919: install-recursive] Error 1
make[2]: Leaving directory '/sources/builddir/gnutls-3.5.11/doc'
make[1]: *** [Makefile:4079: install] Error 2
make[1]: Leaving directory '/sources/builddir/gnutls-3.5.11/doc'
make: *** [Makefile:1463: install-recursive] Error 1

    *** BUILD_PROBLEM_DETECTED ***
I tried re-building gcc and it now gives the following:

Code:
.
.
.
./../gcc/auto-host.h:749:0: warning: "HAVE_DECL_BASENAME" redefined
 #define HAVE_DECL_BASENAME 0
 
In file included from ../../libcc1/plugin.cc:20:0:
./cc1plugin-config.h:6:0: note: this is the location of the previous definition
 #define HAVE_DECL_BASENAME 1
 
mv -f .deps/names.Tpo .deps/names.Plo
In file included from ../../libcc1/../gcc/system.h:266:0,
                 from ../../libcc1/../gcc/gcc-plugin.h:28,
                 from ../../libcc1/plugin.cc:34:
/usr/include/c++/6.3.0/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
                         ^
compilation terminated.
In file included from /usr/include/c++/6.3.0/ext/string_conversions.h:41:0,
                 from /usr/include/c++/6.3.0/bits/basic_string.h:5402,
                 from /usr/include/c++/6.3.0/string:52,
                 from ../../libcc1/findcomp.cc:21:
/usr/include/c++/6.3.0/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
                         ^
compilation terminated.
make[3]: *** [Makefile:472: findcomp.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:472: plugin.lo] Error 1
In file included from /usr/include/c++/6.3.0/ext/string_conversions.h:41:0,
                 from /usr/include/c++/6.3.0/bits/basic_string.h:5402,
                 from /usr/include/c++/6.3.0/string:52,
                 from ../../libcc1/connection.cc:21:
/usr/include/c++/6.3.0/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
                         ^
compilation terminated.
In file included from /usr/include/c++/6.3.0/ext/string_conversions.h:41:0,
                 from /usr/include/c++/6.3.0/bits/basic_string.h:5402,
                 from /usr/include/c++/6.3.0/string:52,
                 from ../../libcc1/libcc1.cc:22:
/usr/include/c++/6.3.0/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
                         ^
compilation terminated.
make[3]: *** [Makefile:472: connection.lo] Error 1
make[3]: *** [Makefile:472: libcc1.lo] Error 1
mv -f .deps/callbacks.Tpo .deps/callbacks.Plo
mv -f .deps/marshall.Tpo .deps/marshall.Plo
make[3]: Leaving directory '/sources/builddir/gcc-6.3.0/build/libcc1'
make[2]: *** [Makefile:547: install] Error 2
make[2]: Leaving directory '/sources/builddir/gcc-6.3.0/build/libcc1'
make[1]: *** [Makefile:9513: install-libcc1] Error 2
cats="po/be.gmo po/ca.gmo po/da.gmo po/de.gmo po/el.gmo po/eo.gmo po/es.gmo po/fi.gmo po/fr.gmo po/id.gmo po/ja.gmo po/nl.gmo po/pt_BR.gmo po/ru.gmo po/sr.gmo po/sv.gmo po/tr.gmo po/uk.gmo po/vi.gmo po/zh_CN.gmo po/zh_TW.gmo po/be.gmo po/ca.gmo po/da.gmo po/de.gmo po/el.gmo po/eo.gmo po/es.gmo po/fi.gmo po/fr.gmo po/id.gmo po/ja.gmo po/nl.gmo po/pt_BR.gmo po/ru.gmo po/sr.gmo po/sv.gmo po/tr.gmo po/uk.gmo po/vi.gmo po/zh_CN.gmo po/zh_TW.gmo"; for cat in $cats; do \
  lang=`basename $cat | sed 's/\.gmo$//'`; \
  if [ -f $cat ]; then :; \
  elif [ -f ../../libcpp/$cat ]; then cat=../../libcpp/$cat; \
  else continue; \
  fi; \
  dir=/usr/share/locale/$lang/LC_MESSAGES; \
  echo /usr/bin/install -c -m 644 $cat /sources/buildmgr/pkgroot$dir/cpplib.mo; \
  /usr/bin/install -c -m 644 $cat /sources/buildmgr/pkgroot$dir/cpplib.mo; \
done
/usr/bin/install -c -m 644 ../../libcpp/po/be.gmo /sources/buildmgr/pkgroot/usr/share/locale/be/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/ca.gmo /sources/buildmgr/pkgroot/usr/share/locale/ca/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/da.gmo /sources/buildmgr/pkgroot/usr/share/locale/da/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/de.gmo /sources/buildmgr/pkgroot/usr/share/locale/de/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/el.gmo /sources/buildmgr/pkgroot/usr/share/locale/el/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/eo.gmo /sources/buildmgr/pkgroot/usr/share/locale/eo/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/es.gmo /sources/buildmgr/pkgroot/usr/share/locale/es/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/fi.gmo /sources/buildmgr/pkgroot/usr/share/locale/fi/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/fr.gmo /sources/buildmgr/pkgroot/usr/share/locale/fr/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/id.gmo /sources/buildmgr/pkgroot/usr/share/locale/id/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/ja.gmo /sources/buildmgr/pkgroot/usr/share/locale/ja/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/nl.gmo /sources/buildmgr/pkgroot/usr/share/locale/nl/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/pt_BR.gmo /sources/buildmgr/pkgroot/usr/share/locale/pt_BR/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/ru.gmo /sources/buildmgr/pkgroot/usr/share/locale/ru/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/sr.gmo /sources/buildmgr/pkgroot/usr/share/locale/sr/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/sv.gmo /sources/buildmgr/pkgroot/usr/share/locale/sv/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/tr.gmo /sources/buildmgr/pkgroot/usr/share/locale/tr/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/uk.gmo /sources/buildmgr/pkgroot/usr/share/locale/uk/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/vi.gmo /sources/buildmgr/pkgroot/usr/share/locale/vi/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/zh_CN.gmo /sources/buildmgr/pkgroot/usr/share/locale/zh_CN/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/zh_TW.gmo /sources/buildmgr/pkgroot/usr/share/locale/zh_TW/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/be.gmo /sources/buildmgr/pkgroot/usr/share/locale/be/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/ca.gmo /sources/buildmgr/pkgroot/usr/share/locale/ca/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/da.gmo /sources/buildmgr/pkgroot/usr/share/locale/da/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/de.gmo /sources/buildmgr/pkgroot/usr/share/locale/de/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/el.gmo /sources/buildmgr/pkgroot/usr/share/locale/el/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/eo.gmo /sources/buildmgr/pkgroot/usr/share/locale/eo/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/es.gmo /sources/buildmgr/pkgroot/usr/share/locale/es/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/fi.gmo /sources/buildmgr/pkgroot/usr/share/locale/fi/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/fr.gmo /sources/buildmgr/pkgroot/usr/share/locale/fr/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/id.gmo /sources/buildmgr/pkgroot/usr/share/locale/id/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/ja.gmo /sources/buildmgr/pkgroot/usr/share/locale/ja/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/nl.gmo /sources/buildmgr/pkgroot/usr/share/locale/nl/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/pt_BR.gmo /sources/buildmgr/pkgroot/usr/share/locale/pt_BR/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/ru.gmo /sources/buildmgr/pkgroot/usr/share/locale/ru/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/sr.gmo /sources/buildmgr/pkgroot/usr/share/locale/sr/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/sv.gmo /sources/buildmgr/pkgroot/usr/share/locale/sv/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/tr.gmo /sources/buildmgr/pkgroot/usr/share/locale/tr/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/uk.gmo /sources/buildmgr/pkgroot/usr/share/locale/uk/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/vi.gmo /sources/buildmgr/pkgroot/usr/share/locale/vi/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/zh_CN.gmo /sources/buildmgr/pkgroot/usr/share/locale/zh_CN/LC_MESSAGES/cpplib.mo
/usr/bin/install -c -m 644 ../../libcpp/po/zh_TW.gmo /sources/buildmgr/pkgroot/usr/share/locale/zh_TW/LC_MESSAGES/cpplib.mo
make[2]: Leaving directory '/sources/builddir/gcc-6.3.0/build/libcpp'
make[1]: Leaving directory '/sources/builddir/gcc-6.3.0/build'
make: *** [Makefile:2293: install] Error 2

    *** BUILD_PROBLEM_DETECTED ***

'/sources/buildmgr/pkgroot/lib/cpp' -> '../usr/bin/cpp'
'/sources/buildmgr/pkgroot/usr/bin/cc' -> 'gcc'
'/sources/buildmgr/pkgroot/usr/lib/bfd-plugins/liblto_plugin.so' -> '../../libexec/gcc/x86_64-pc-linux-gnu/6.3.0/liblto_plugin.so'
mv: cannot stat '/sources/buildmgr/pkgroot/usr/lib/*gdb.py': No such file or directory

    *** BUILD_PROBLEM_DETECTED ***
I have these as showing built on this system:

Code:
/usr/include/stdlib.h
/usr/include/bash/include/ansi_stdlib.h
/usr/include/bits/stdlib.h
/usr/include/c++/6.3.0/stdlib.h
/usr/include/c++/6.3.0/tr1/stdlib.h
Any help on this would be appreciated.

percy
 
Old 04-06-2018, 09:34 AM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by percy_vere_uk View Post
Hi

I am using lfscript and have installed the base system without noticing any errors. But when I try to build gnutls I get the following:

Code:
/usr/include/c++/6.3.0/cstdlib:75:25: fatal error: stdlib.h: No such file or directory  #include_next <stdlib.h> ]]]
 #include_next <stdlib.h>
Any help on this would be appreciated.

percy
C++??????
I've never seen it be declared as
Code:
#include_next <someFile.h>
just
Code:
#include <iostream>
#include <vector>
#include <algorithm>
#include </usr/include/Imlib2.h>
#include <pwd.h>
in c++ you can use
Code:
cstdlib
// in lue of
stdlib.h
EDIT:
Ok I found something on this #include_next thing
https://gcc.gnu.org/onlinedocs/cpp/Wrapper-Headers.html

Last edited by BW-userx; 04-06-2018 at 09:45 AM.
 
2 members found this post helpful.
Old 04-07-2018, 08:54 AM   #3
percy_vere_uk
Member
 
Registered: Oct 2008
Location: Dorset, UK
Distribution: Arch, Lfs, Gentoo, Debian, Slackware
Posts: 98

Original Poster
Rep: Reputation: 12
BW-userx

Thanks for your prompt reply.

I added:

Quote:
cstdlib
// in lue of
stdlib.h
To /usr/include/c++/6.3.0/cstdlib which now gives the error:

Code:
‘cstdlib’ does not name a type
I do not understand this error or what steps to take.

Last edited by percy_vere_uk; 04-07-2018 at 08:56 AM.
 
Old 08-13-2018, 12:30 AM   #4
Andy Alt
Member
 
Registered: Jun 2004
Location: Minnesota, USA
Distribution: Slackware64-stable, Manjaro, Debian64 stable
Posts: 528

Rep: Reputation: 167Reputation: 167
I'm experiencing this problem as well, using gcc 8.2.0 on Slackware64-current, working with the svn code for 0 A.D. (as a minor contributor)

Quote:
andy@demeter:~/src/0ad/trunk/build/workspaces/gcc$ make
==== Building mocks_real (release) ====
mocks_real.cpp
In file included from ../../../source/lib/sysdep/stl.h:32,
from ../../../source/lib/precompiled.h:68,
from ../../../source/mocks/mocks_real.cpp:26:
/usr/include/c++/8.2.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
make[1]: *** [mocks_real.make:123: obj/mocks_real_Release/mocks_real.o] Error 1
make: *** [Makefile:141: mocks_real] Error 2
This is also apparently a problem on Arch Linux using gcc 8.1.0

The 0 A.D. developers are aware of this and there's an open ticket for it, so I did ask there first xD

Last edited by Andy Alt; 08-13-2018 at 12:42 AM.
 
Old 08-14-2018, 08:39 AM   #5
percy_vere_uk
Member
 
Registered: Oct 2008
Location: Dorset, UK
Distribution: Arch, Lfs, Gentoo, Debian, Slackware
Posts: 98

Original Poster
Rep: Reputation: 12
Andy Alt

Sorry I can't shed any light on this I have since moved away from lfscript. So I will mark this as closed.

Best of luck

percy
 
Old 08-31-2019, 05:58 AM   #6
shevegen
Member
 
Registered: May 2004
Distribution: Slackware / GoboLinux / LFS / VoidLinux
Posts: 145

Rep: Reputation: 26
I got almost the same problem.

This is all due to GCC's intrinsic complexity when it comes to C++. #include_next works
even less when you use an unusual directory layout. Note that with C I do not have this
problem AT ALL - all works fine via C, including my unusual directory layout. But with
C++ nope - it wants to search the directory where it put the cstdlib part and the
pre-generated "stdlib.h" which is different from glibc, so of course that does not work
and it fails like crazy.

In my opinion the madness started with fixincludes, and people should instead FAIL HARD
rather than try to make things work by "fixing" something which only leads up to more
breakage lateron down the road. Very annoying.
 
Old 01-23-2020, 08:59 AM   #7
arch-linq
Member
 
Registered: Sep 2018
Location: Midwest, USA
Distribution: Arch,LFS,BLFS
Posts: 110

Rep: Reputation: Disabled
This is nasty error imo. Found it only on an attempt to build pcre-8.43 for aarch64/arm64 for my Rock64 board. Configue cmd goes fine but error with/wo jit (can't find a patch).

Code:
   from pcrecpp_unittest.cc:44:
/usr/include/c++/9.2.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
   75 | #include_next <stdlib.h>
      |               ^~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:2391: pcrecpp_unittest-pcrecpp_unittest.o] Error 1
Arch arm uses a patch for loop in their pcre PKGBUILD. I can't decipher it for blfs use however.

Google gives almost nothing on this but it has happened at gentoo. Ideas to get pcre to compile?
 
Old 01-23-2020, 04:07 PM   #8
TheRealGrogan
Member
 
Registered: Oct 2010
Location: Ontario, Canada
Distribution: Slackware, LFS, Manjaro (for gaming)
Posts: 570

Rep: Reputation: 413Reputation: 413Reputation: 413Reputation: 413Reputation: 413
That's supposed to be finding stdlib.h in /usr/include (glibc's stdlib.h). That's why they are using #include_next in gcc's cstdlib rather than #include which would find stdlib.h in same directory.

It should be there if using glibc and not some other C library. Verify that your glibc installation is intact.
 
Old 01-24-2020, 08:18 AM   #9
arch-linq
Member
 
Registered: Sep 2018
Location: Midwest, USA
Distribution: Arch,LFS,BLFS
Posts: 110

Rep: Reputation: Disabled
Thks Grogan for a clear answer. It is possible its my glibc since this is a build that has no precedent other than rpi-pilfs which I used as a guide with ubu-bionic-armbian as host. Somehow -isystem is in the ggc 9 config and it was told to me by a gcc guy in irc chan that that setting confuses the lib/header search order functions. Main sysd-lfs does not use it and I dont see how it got in my build or how to prevent it or get around it. Weird thing is all the other pkgs built up to pcre in blfs.

I'll run some glic tests other than just the one in the book which passed.
 
Old 06-29-2021, 08:52 PM   #10
themightydill
LQ Newbie
 
Registered: Apr 2021
Location: Edmonton, AB
Distribution: Arch and derivatives, Debian, Fedora, LFS 10.1
Posts: 20

Rep: Reputation: 10
I'm having the same problem compiling LLVM-11.1.0, using lfs-10.1-systemd. Does anyone have the same problem?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to link two projects, one with linux stdlib and one without linux stdlib eddchr Programming 0 12-17-2008 09:52 AM
gcc compiler cannot find header file stdio.h / stdlib.h debianlam Programming 2 05-11-2008 02:29 PM
gcc compiler cannot find header file stdio.h / stdlib.h debianlam Programming 2 05-09-2008 03:33 PM
No stdlib's in Slackware 10.2?? DavidHB Linux - Distributions 3 02-25-2006 09:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 11:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration