Linux From ScratchThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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?
"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.
#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)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.