LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Compile SDL app in Slackware64 w Eric's Multilib installed (http://www.linuxquestions.org/questions/slackware-14/compile-sdl-app-in-slackware64-w-erics-multilib-installed-817848/)

lightkuragari 07-03-2010 12:38 PM

Compile SDL app in Slackware64 w Eric's Multilib installed
 
Hi, I'm using slackware 64 13.1 and i followed alien bob's guide to a multilib system. Everything went amazingly perfect, i upgraded the listed packages, installed the compat32 packages and reinstalled my nvidia driver to include opengl 32 bit libs. After this i installed Eric's wine x86_64 package and configured DirectX, set up GTA San Andreas and all worked perfectly.

The problem now is that i tried to resume a development i'm currently working on, so i set up eclipse and cdt, created a new project, added my existing sources, i set up the libraries SDLmain, SDL and SDL_ttf (i have done this several times without any problem in 32 and 64 bit, but never with multilib), compiled and surprise!!! The linker says it can't find the following library:

/usr/lib64/gcc/x86_64-slackware-linux/4.4.4/../../../../x86_64-slackware-linux/bin/ld: warning: libXrandr.so.2, needed by /usr/lib64/gcc/x86_64-slackware-linux/4.4.4/../../../../lib/libSDL.so, not found (try using -rpath or -rpath-link)

so, i "slocated" it and found it in /usr/lib64.
I tried solving this by adding /usr/lib64 to /etc/ld.conf.so but it threw different errors in libSDL, so i guess it wasn't the right move. Could someone please orient me here? In my project environment, these are the directories listed in Include:

/usr/include
/usr/include/c++/4.4.4/
/usr/include/c++/4.4.4/backward
/usr/include/c++/x86_64-slackware-linux/32
/usr/lib64/gcc/x86_64-slackware-linux/4.4.4/include
/usr/lib64/gcc/x86_64-slackware-linux/4.4.4/include-fixed
/usr/lib64/qt/include
/usr/local/include

and no other is set in my project's include path.
What do you think is wrong?

Alien Bob 07-03-2010 04:02 PM

I see two possibilities, but you are not clear about it.

Either you are trying to compile a 32-bit program, after you have installed a full set of -compat32 packages (32-bit Slackware packages re-packaged for Slackware64's multilib). You would have libXrandr-compat32 on your system which provides the library file /usr/lib/libXrandr.so.2.2.0 and the symbolic link to that file, /usr/lib/libXrandr.so.2. In that case, you seem to be missing that package.

Or, you are trying to compile a 64-bit binary, and you are being bitten by the fact that /usr/lib64 is not searched before /usr/lib - we explain this in our slackbuilds.org FAQ: http://slackbuilds.org/faq/#multilib

Eric

lightkuragari 07-04-2010 08:15 PM

Thanks for the answer!
 
Somehow i thought i'd get an answer from you. That's great, thanks!

Currently i just want to compile my program in 64-bit, not as a requirement, i mean i just wanted to compile it for my current system configuration, later i will deal with cross compiling and all, but right now i'm only debugging and testing so i just want the thing to run.

As i was in a hurry, i chose to revert the multilib conversion process, so now i have my 64-bit only system again, which i love ( goodbye GTA :cry: )

But will give it a try again sometime soon. In the meantime, i think you gave me a valuable hint, but from what you say i suppose my application was getting compiled as a 32-bit app, because it looked for /usr/lib instead of /usr/lib64, right?

Anyway, thank you very much Eric. I hope this thread helps someone else as well because i haven't had the opportunity to help some other soul in disgrace :P mm... i wonder if i should mark this post as SOLVED?

Petri Kaukasoina 07-05-2010 03:05 AM

Quote:

Originally Posted by lightkuragari (Post 4023885)
As i was in a hurry, i chose to revert the multilib conversion process, so now i have my 64-bit only system again, which i love ( goodbye GTA :cry: )

It is also possible to install multilib only partly to allow running 32-bit binaries without the ability to compile code to 32-bit binaries:

1. Don't install the multilib gcc packages, the vanilla Slackware gcc packages are enough.

2. Install the multilib glibc packages and the compat32-tools and all the compat32 compatibility packages.

3. remove all such stuff from the 32-bit /usr/lib and /lib directories what linker and configure scripts etc. might look, still leaving runtime support for 32-bit binaries:
Code:

rm $(find /usr/lib -maxdepth 1 -type l -name '*.so')
rm $(find /lib -maxdepth 1 -type l -name '*.so')
rm /usr/lib/libpthread.so /usr/lib/libc.so
rm /usr/lib/*.a /usr/lib/*.o /usr/lib/*.la
rm /lib/*.a /lib/*.la
rm /usr/lib/pkgconfig/*

This way your building process only finds the 64-bit stuff but you also have the 32-bit runtime compatibility needed to install and run 32-bit binaries.

lightkuragari 07-06-2010 08:54 AM

Thanks Petri, that's an interesting point, i didn't think about that.

I will try it when i have the chance.


All times are GMT -5. The time now is 10:01 AM.