Different binary size

Admin-Stress meerkapot@yahoo.com
Tue Mar 23 10:12:00 GMT 2004

I compiled a program in two machines, both are using the same gcc, MySQL library, and glibc (both
are RedHat 9).

The first machine (MACHINE_1) produced 20 KB binary size, but in second machine (MACHINE_2)
produced 181 KB binary size.

I know that the problem is MACHINE_2 cant dynamically link the libray. How can I fix this in
MACHINE_2 so it can produce dynamic link? 

Here is my compile script :

gcc -o iaac iaac.c -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient -lz

Please help me.

in MACHINE_1 :

$ ldd iaac
        libmysqlclient.so.12 => /usr/lib/libmysqlclient.so.12 (0x4001c000)
        libz.so.1 => /usr/lib/libz.so.1 (0x40052000)
        libc.so.6 => /lib/libc.so.6 (0x40060000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x40187000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x401b3000)
        libm.so.6 => /lib/libm.so.6 (0x401c7000)
        libnss_files.so.2 => /lib/libnss_files.so.2 (0x401e8000)
        libnss_dns.so.2 => /lib/libnss_dns.so.2 (0x401f3000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x401f7000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

in MACHINE_2 :

$ ldd iaac
        libz.so.1 => /usr/lib/libz.so.1 (0x4001d000)
        libc.so.6 => /lib/i686/libc.so.6 (0x4002c000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

More information about the Gcc-help mailing list