Results 1 to 3 of 3

Thread: 32 bit compile/link on 64 bit system

Hybrid View

  1. #1

    Default 32 bit compile/link on 64 bit system

    $ cat aa.c
    #include <stdio.h>

    int main(void)
    {
    printf("hello world\n");
    return(0);
    }

    gcc -m32 aa.c
    /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.5/libgcc.a when searching for -lgcc
    /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: cannot find -lgcc


    I need to link a C program to some 32-bit libraries.

    /lib
    -rwxr-xr-x 1 root root 116348 2010-07-01 14:29 libgcc_s.so.1
    $ file libgcc_s.so.1
    libgcc_s.so.1: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped

    Thank you for your time.

  2. #2
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: 32 bit compile/link on 64 bit system

    Check if you have a file
    /usr/lib64/gcc/x86_64-suse-linux/4.5/32/libgcc.a
    (note the 32 in the path name).
    If not install gcc45-32bit

    --
    PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.1 | GeForce
    9600 GT | 4GB Ram
    Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.0 | nVidia
    ION | 3GB Ram

  3. #3

    Default Re: 32 bit compile/link on 64 bit system

    Thanks Martin - that' the ticket

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •