LinuxQuestions.org
Review your favorite Linux distribution.
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 12-28-2005, 05:35 PM   #1
Kenji Miyamoto
Member
 
Registered: Dec 2004
Distribution: Mandrake 10.1; Fedora Core 3; FreeBSD 5.3; Slackware 10.1 (2.6.10);
Posts: 234

Rep: Reputation: 30
GCC 4.0.2 Chroot Build Unable to Find Headers


When building GCC 4.0.2, make fails with this error:
Code:
/sources/gcc-build/gcc/xgcc -B/sources/gcc-build/gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -isystem /usr/i686-pc-linux-gnu/sys-include -O2 -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -I. -I. -I../../gcc-4.0.2/gcc -I../../gcc-4.0.2/gcc/. -I../../gcc-4.0.2/gcc/../include -I../../gcc-4.0.2/gcc/../libcpp/include   -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-unit-at-a-time -fno-omit-frame-pointer \
   -c ../../gcc-4.0.2/gcc/crtstuff.c -DCRT_BEGIN \
  -o crtbegin.o
In file included from ../../gcc-4.0.2/gcc/crtstuff.c:64:
../../gcc-4.0.2/gcc/tsystem.h:90:19: error: stdio.h: No such file or directory
../../gcc-4.0.2/gcc/tsystem.h:93:23: error: sys/types.h: No such file or directory
../../gcc-4.0.2/gcc/tsystem.h:96:19: error: errno.h: No such file or directory
../../gcc-4.0.2/gcc/tsystem.h:103:20: error: string.h: No such file or directory
../../gcc-4.0.2/gcc/tsystem.h:104:20: error: stdlib.h: No such file or directory
../../gcc-4.0.2/gcc/tsystem.h:105:20: error: unistd.h: No such file or directory
In file included from /sources/gcc-build/gcc/include/syslimits.h:7,
                 from /sources/gcc-build/gcc/include/limits.h:11,
                 from ../../gcc-4.0.2/gcc/tsystem.h:108,
                 from ../../gcc-4.0.2/gcc/crtstuff.c:64:
/sources/gcc-build/gcc/include/limits.h:122:61: error: limits.h: No such file or directory
In file included from ../../gcc-4.0.2/gcc/crtstuff.c:64:
../../gcc-4.0.2/gcc/tsystem.h:111:18: error: time.h: No such file or directory
make[1]: *** [crtbegin.o] Error 1
make[1]: Leaving directory `/sources/gcc-build/gcc'
make: *** [all-gcc] Error 2
Why does this happen when I am able to build programs with the same includes?
 
Old 01-12-2006, 03:17 AM   #2
shotokan
Member
 
Registered: Mar 2005
Distribution: slackware, LFS
Posts: 204

Rep: Reputation: 30
"Some locales installed by the make localedata/install-locales command above are not properly
supported by some applications that are in the LFS and BLFS books. Because of the various
problems that arise due to application programmers making assumptions that break in such
locales, LFS should not be used in locales that utilize multibyte character sets (including
UTF-8) or right-to-left writing order." - LFS-BOOK 6.11. Glibc-2.3.4

I suppose that can be applicable to includes as well.

Last edited by shotokan; 01-12-2006 at 03:23 AM.
 
Old 01-28-2006, 01:24 AM   #3
newcomer4
LQ Newbie
 
Registered: Jan 2006
Posts: 21

Rep: Reputation: 15
I am also having same problem.plz help me
 
Old 02-16-2006, 05:28 AM   #4
shotokan
Member
 
Registered: Mar 2005
Distribution: slackware, LFS
Posts: 204

Rep: Reputation: 30
Wait a minute I just noticed your useing a GCC 4.0 instead of 3.4. The book dosent cover that.

But if your going to try this you might have to ask the GCC developers some questions to get it working.
 
Old 03-14-2006, 12:51 PM   #5
brccabral
LQ Newbie
 
Registered: Mar 2006
Posts: 1

Rep: Reputation: 0
also having this problem

hi... here is my program "teste.c"


#include <iostream>
#include <string>
using namespace std;

int main(int argc, char** argv) {
string name;
if (argc > 1) name = argv[1];
else cin >> name;
cout << "Hello, " + name +"\n";
return 0;
}


here is the results

:~$ gcc teste.c -o teste
teste.c:1:20: error: iostream: Arquivo ou diretório não encontrado
teste.c:2:18: error: string: Arquivo ou diretório não encontrado
teste.c:3: error: syntax error before 'namespace'
teste.c:3: warning: data definition has no type or storage class
teste.c: In function 'main':
teste.c:6: error: 'string' undeclared (first use in this function)
teste.c:6: error: (Each undeclared identifier is reported only once
teste.c:6: error: for each function it appears in.)
teste.c:6: error: syntax error before 'name'
teste.c:7: error: 'name' undeclared (first use in this function)
teste.c:8: error: 'cin' undeclared (first use in this function)
teste.c:9: error: 'cout' undeclared (first use in this function)

("Arquivo ou diretório não encontrado" means " No such file or directory" in portuguese)

if it helps..
~$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-awt=gtk-default --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --with-tune=i686 --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.0.3 20060212 (prerelease) (Debian 4.0.2-9)

help me!!!!
 
Old 06-29-2006, 03:34 AM   #6
Linux von Scratchen
LQ Newbie
 
Registered: Jun 2006
Location: orbiting around Saturn
Distribution: LFS, knoppix
Posts: 16

Rep: Reputation: 0
Quote:
:~$ gcc teste.c -o teste
teste.c:1:20: error: iostream: Arquivo ou diretório não encontrado
use g++ not gcc

with that change, your test program compiles fine on my machine.
using gcc, i got the same errors you did.
 
  


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
Glibc Unable to Find Kernel Headers Kenji Miyamoto Linux From Scratch 6 12-30-2008 04:03 PM
Build a 32 bit chroot? Tomex Fedora 1 11-14-2005 12:31 PM
how to build a 32 bit chroot for 64bit nathj72 Linux - Newbie 1 03-26-2005 03:14 PM
kernel build from gcc 3.3.2 to gcc 3.4.1 alcarbone Linux - Software 1 09-13-2004 08:19 AM
Gcc/Headers trouby Linux - General 6 10-14-2003 09:47 PM

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

All times are GMT -5. The time now is 03:18 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