Stuck at cross compile G++ compilation
Hi,
Ok, i successfully followed the CLFS stable book, and went till 5.9. Cross GCC-4.2.4 - Final
Now i want to stop here, because all i want is just the cross compiled Gcc, G++, Glibc and the linker search path should be referenced to my /tools/lib da..da..
I see that i do that.
Now i created two sample programs one 'c++' and other one 'c' printing "hello World"
when i try to compile these two programs, i get the following error while linking.
Could someone please help me through.
clfs:/mnt/cross/x86/sources/test$ ${CLFS_TARGET}-g++ file.cc
In file included from /mnt/cross/x86/cross-tools/bin/../lib/gcc/i686-sb-linux-gnu/4.2.4/../../../../i686-sb-linux-gnu/include/c++/4.2.4/backward/iostream.h:31,
from file.cc:1:
/mnt/cross/x86/cross-tools/bin/../lib/gcc/i686-sb-linux-gnu/4.2.4/../../../../i686-sb-linux-gnu/include/c++/4.2.4/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
clfs:/mnt/cross/x86/sources/test$ ls
a.out file.cc
clfs:/mnt/cross/x86/sources/test$ readelf -l a.out | grep ' : /tools'
clfs:/mnt/cross/x86/sources/test$ readelf -l a.out
Elf file type is EXEC (Executable file)
Entry point 0x8048640
There are 8 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000034 0x08048034 0x08048034 0x00100 0x00100 R E 0x4
INTERP 0x000134 0x08048134 0x08048134 0x00019 0x00019 R 0x1
[Requesting program interpreter: /tools/lib/ld-linux.so.2]
LOAD 0x000000 0x08048000 0x08048000 0x00aac 0x00aac R E 0x1000
LOAD 0x000aac 0x08049aac 0x08049aac 0x00140 0x00200 RW 0x1000
DYNAMIC 0x000ac4 0x08049ac4 0x08049ac4 0x000e0 0x000e0 RW 0x4
NOTE 0x000150 0x08048150 0x08048150 0x00020 0x00020 R 0x4
GNU_EH_FRAME 0x0009c0 0x080489c0 0x080489c0 0x00034 0x00034 R 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x4
Section to Segment mapping:
Segment Sections...
00
01 .interp
02 .interp .note.ABI-tag .hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .eh_frame_hdr .eh_frame
03 .ctors .dtors .jcr .dynamic .got .got.plt .data .bss
04 .dynamic
05 .note.ABI-tag
06 .eh_frame_hdr
07
clfs:/mnt/cross/x86/sources/test$ ls
a.out file.cc
clfs:/mnt/cross/x86/sources/test$ ./a.out
./a.out: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
clfs:/mnt/cross/x86/sources/test$ vim file1.c
clfs:/mnt/cross/x86/sources/test$ ${CLFS_TARGET}-gcc file1.c
file1.c: In function 'main':
file1.c:3: warning: return type of 'main' is not 'int'
clfs:/mnt/cross/x86/sources/test$ ls
a.out file.cc file1.c
clfs:/mnt/cross/x86/sources/test$ ./a.out
./a.out: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory
clfs:/mnt/cross/x86/sources/test$
|