Results 1 to 8 of 8

Thread: Compiling 32 bit on 64 bit Ubuntu not working...

  1. #1
    Join Date
    May 2010
    Location
    Austria
    Beans
    Hidden!
    Distro
    Xubuntu

    Compiling 32 bit on 64 bit Ubuntu not working...

    Hi!
    I already searched on Google for hours now, about this problem....
    Nothing worked for me....
    My problem..
    I have a c++ program, I want to compile for 32bit pc's... I have 64bit Ubuntu..
    64bit compiling worked well, no errors
    I read that I have to add -m32 to compile for 32 bit...
    So far so good...
    There was the SDL 32bit library missing... I downloaded it...
    Okay...
    Now the lstdc++ 32bit is missing... I downloaded, but it always says:
    Code:
    g++ -m32 main.cpp -o Bubbles32 -lSDL -lSDL_ttf -lstdc++ -Wall
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
    /usr/bin/ld: cannot find -lstdc++
    collect2: ld returned 1 exit status
    How can I fix this?
    Please help me,
    Yours,
    Daniel
    Founder of Ubuntu Austria LoCo
    If you need GERMAN support, post here!
    Council member of Ubuntu Youth.

  2. #2
    Join Date
    Oct 2007
    Beans
    1,914
    Distro
    Lubuntu 12.10 Quantal Quetzal

    Re: Compiling 32 bit on 64 bit Ubuntu not working...

    Try installing the "g++-multilib" package. It contains non-native library versions for many standard libraries.

  3. #3
    Join Date
    May 2010
    Location
    Austria
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: Compiling 32 bit on 64 bit Ubuntu not working...

    Hi!
    I currently upgraded from 10.04 to 10.10
    I entered your command..
    Now I get:
    Code:
    g++ main.cpp -o Bubbles32 -lSDL -lSDL_ttf -m32
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libSDL.so when searching for -lSDL
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libSDL.a when searching for -lSDL
    /usr/bin/ld: skipping incompatible //usr/lib/libSDL.so when searching for -lSDL
    /usr/bin/ld: skipping incompatible //usr/lib/libSDL.a when searching for -lSDL
    /usr/bin/ld: cannot find -lSDL
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libSDL_ttf.so when searching for -lSDL_ttf
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libSDL_ttf.a when searching for -lSDL_ttf
    /usr/bin/ld: skipping incompatible //usr/lib/libSDL_ttf.so when searching for -lSDL_ttf
    /usr/bin/ld: skipping incompatible //usr/lib/libSDL_ttf.a when searching for -lSDL_ttf
    /usr/bin/ld: cannot find -lSDL_ttf
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.so when searching for -lstdc++
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a when searching for -lstdc++
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.so when searching for -lstdc++
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a when searching for -lstdc++
    /usr/bin/ld: cannot find -lstdc++
    collect2: ld returned 1 exit status
    I need some libs for 32bit But don't know where to download them
    Yours,
    Daniel
    Founder of Ubuntu Austria LoCo
    If you need GERMAN support, post here!
    Council member of Ubuntu Youth.

  4. #4
    Join Date
    Oct 2007
    Beans
    1,914
    Distro
    Lubuntu 12.10 Quantal Quetzal

    Re: Compiling 32 bit on 64 bit Ubuntu not working...

    Quote Originally Posted by Daniel0108 View Post
    I entered your command..
    Which command?

    Note that there is a tool for installing 32-bit libraries on a 64-bit system. I'm not sure if it helps you, but you might want to give it a try:
    http://ubuntuforums.org/showthread.php?t=474790
    Last edited by Zugzwang; October 25th, 2010 at 04:21 PM.

  5. #5
    Join Date
    Sep 2009
    Location
    U.S. Arizona
    Beans
    73
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Compiling 32 bit on 64 bit Ubuntu not working...

    You could always download the i386 .deb file from http://packages.ubuntu.com/, manually extract the needed files, and then copy them into your /usr/lib directory.

  6. #6
    Join Date
    Apr 2009
    Location
    Germany
    Beans
    2,134
    Distro
    Ubuntu Development Release

    Re: Compiling 32 bit on 64 bit Ubuntu not working...

    Quote Originally Posted by Eragon0605 View Post
    You could always download the i386 .deb file from http://packages.ubuntu.com/, manually extract the needed files, and then copy them into your /usr/lib directory.
    better use dpkg -i --force-architecture instead of manual extracting.
    Or extract them to some other directory (like /usr/local/lib) and give that path to the compiler

    and you still seem to be missing g++-multilib.
    Last edited by MadCow108; October 25th, 2010 at 11:20 PM.

  7. #7
    Join Date
    May 2010
    Location
    Austria
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: Compiling 32 bit on 64 bit Ubuntu not working...

    Quote Originally Posted by MadCow108 View Post
    and you still seem to be missing g++-multilib.
    Yeah, that's right, I was missing it on my 10.04.. and installed it Now I formatted my harddisk and installed 10.10 And thought I already installed it
    I used getlibs and installed the g++-multilib.
    Now it's working
    THANKS
    Yours,
    Daniel
    Founder of Ubuntu Austria LoCo
    If you need GERMAN support, post here!
    Council member of Ubuntu Youth.

  8. #8
    Join Date
    Sep 2008
    Beans
    53

    Re: Compiling 32 bit on 64 bit Ubuntu not working...

    Quote Originally Posted by Zugzwang View Post
    Try installing the "g++-multilib" package. It contains non-native library versions for many standard libraries.

    Thank You

Tags for this Thread

Bookmarks

Posting Permissions

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