LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-14-2008, 07:07 AM   #1
donnied
Member
 
Registered: Oct 2006
Distribution: Debian x64
Posts: 198

Rep: Reputation: 30
how to cross compile libsdl_image for 386 on x64?


I'm trying to run a program that uses libsdl_image and I get this error message:
Code:
error while loading shared libraries: libSDL_image-1.2.so.0: cannot open shared object file: No such file or directory
If I check with ldd I see that:
Code:
 libSDL-1.2.so.0 => /usr/lib32/libSDL-1.2.so.0 (0xf7ec2000)
        libSDL_image-1.2.so.0 => not found
        libSDL_ttf-2.0.so.0 => not found
        libSDL_mixer-1.2.so.0 => not found
and ls -l shows me that there is a link:
Code:
libSDL_image-1.2.so.0 -> libSDL_image-1.2.so.0.1.5
and file shows me:
Code:
/usr/lib/libSDL_image-1.2.so.0.1.5: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
So, I cross compile. I specify installation path as /usr/lib32/? and put links?

(I'm using Debian so there isn't a ia32-libs-sdl package as in Ubuntu; could I get the source for Ubuntu and compile for Debian? I did a dpkg install of the ubuntu package but removed it because it didn't do anything and was sub optimal.)
 
Old 09-14-2008, 11:00 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,747
Blog Entries: 1

Rep: Reputation: 225Reputation: 225Reputation: 225
You could execute ldconfig to see if that takes care of the problem not finding the SDL libraries. Also, SDL installs the file sdl-config. This is used by other applications when they are built against SDL to get information that is passed to gcc. For example, on my x86_64 box, I have both 32-bit and 64-bit SDL installed and checking the --libs (there are other switches to pass to sdl-config)
Code:
103 files(230M bytes) - /home/weibullguy
weibullguy@aragorn for 0h55m $ USE_ARCH=64 sdl-config --libs
-L/usr/lib64 -Wl,-rpath,/usr/lib64 -lSDL -lpthread

103 files(230M bytes) - /home/weibullguy
weibullguy@aragorn for 0h55m $ USE_ARCH=32 sdl-config --libs
-L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread
Whichever ABI is installed first will be over written by the second ABI you install unless there is some way to differentiate between the two. Don't know how Ubuntu/Debian does it, but keep this in mind if you build from source. SDL isn't the only package that has these config files instead of using metadata (*.pc) files.

BTW, you executed file on the 64-bit library, not the 32-bit library.
Code:
/usr/lib/libSDL_image-1.2.so.0.1.5
Of course, the 32-bit libraries are supposed to be in lib, not lib32 IAW the FHS.

Last edited by weibullguy; 09-14-2008 at 11:02 AM.
 
Old 09-14-2008, 08:57 PM   #3
donnied
Member
 
Registered: Oct 2006
Distribution: Debian x64
Posts: 198

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by weibullguy View Post
BTW, you executed file on the 64-bit library, not the 32-bit library.
Code:
/usr/lib/libSDL_image-1.2.so.0.1.5
Of course, the 32-bit libraries are supposed to be in lib, not lib32 IAW the FHS.
Yeah, that seems to be the problem. I don't have the 32 bit library. I tried to set up a cross compiling tool chain earlier but I was unsuccessful. I might look into a chroot to make the file.

Thank you.
 
  


Reply

Tags
compile, cross, sdl


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel 2.6.11 smp x64 compile not working meangene72 Fedora 0 11-26-2005 02:42 AM
How to cross compile? jiyun0121 Linux - General 3 09-01-2005 06:15 PM
Fedora Core4 x64, no way to compile kernel proNick Fedora 2 07-12-2005 10:57 PM
How to cross-compile? karfei00 Linux - Laptop and Netbook 2 06-03-2004 09:56 AM
cannot find libSDL_image-1.2.so.0 polynotre Linux - Newbie 2 12-06-2003 04:57 PM


All times are GMT -5. The time now is 07:15 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration