In a prior email I wrote "libz and libz.so." It should have been "libz.a and libz.so." sorry.
On Wed, 28 Nov 2007, Shocky wrote:
On Tuesday 27 November 2007 17:33, ron minnich wrote:
gcc -o thing thing.c /usr/lib/libpci.a -lz
see what happens.
ron
Aha, that ran successfully. I can even run the thing program, which does nothing other than give me a return code of 8. Seems like progress. Does it give you a clue what's wrong with the linker on Mandriva?
To see what the linker is doing, try this: gcc -o thing thing.c -Xlinker --verbose -lpci -lz
The results you get should look alot like this:
GNU ld (Linux/GNU Binutils) 2.17.50.0.17.20070615 Supported emulations: elf_i386 i386linux elf_x86_64 using internal linker script: ================================================== /* Script for -z combreloc: combine and sort reloc sections */ OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") OUTPUT_ARCH(i386) ENTRY(_start) SEARCH_DIR("/usr/i486-slackware-linux/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); SECTIONS { [..] }
================================================== attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../crt1.o succeeded /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../crt1.o attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../crti.o succeeded /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../crti.o attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/crtbegin.o succeeded /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/crtbegin.o attempt to open /tmp/ccyKMHNi.o succeeded /tmp/ccyKMHNi.o attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libpci.so failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libpci.a failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libpci.so failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libpci.a failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libpci.so failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libpci.a succeeded (/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libpci.a)access.o (/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libpci.a)dump.o (/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libpci.a)names.o (/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libpci.a)sysfs.o (/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libpci.a)proc.o (/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libpci.a)i386-ports.o (/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libpci.a)generic.o attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libz.so failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libz.a failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libz.so failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libz.a failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libz.so succeeded -lz (/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libz.so) attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc.so failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc.a succeeded attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc_s.so failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc_s.a failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc_s.so failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc_s.a failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libgcc_s.so succeeded -lgcc_s (/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libgcc_s.so) attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libc.so failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libc.a failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libc.so failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libc.a failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libc.so succeeded opened script file /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libc.so opened script file /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libc.so attempt to open /lib/libc.so.6 succeeded /lib/libc.so.6 attempt to open /usr/lib/libc_nonshared.a succeeded (/usr/lib/libc_nonshared.a)elf-init.oS attempt to open /lib/ld-linux.so.2 succeeded /lib/ld-linux.so.2 attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc.so failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc.a succeeded attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc_s.so failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc_s.a failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc_s.so failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc_s.a failed attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libgcc_s.so succeeded -lgcc_s (/usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../libgcc_s.so) attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/crtend.o succeeded /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/crtend.o attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../crtn.o succeeded /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../crtn.o ld-linux.so.2 needed by /lib/libc.so.6 found ld-linux.so.2 at /lib/ld-linux.so.2
Russ