LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   GCC 4.0.2 Chroot Build Unable to Find Headers (http://www.linuxquestions.org/questions/linux-from-scratch-13/gcc-4-0-2-chroot-build-unable-to-find-headers-397346/)

Kenji Miyamoto 12-28-2005 05:35 PM

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?

shotokan 01-12-2006 03:17 AM

"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.

newcomer4 01-28-2006 01:24 AM

I am also having same problem.plz help me

shotokan 02-16-2006 05:28 AM

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.

brccabral 03-14-2006 12:51 PM

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!!!!

Linux von Scratchen 06-29-2006 03:34 AM

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.


All times are GMT -5. The time now is 03:55 AM.