PDA

View Full Version : find / install 32-bit X11 libs on 64-bit ubuntu



bootstrap
08-27-2010, 05:04 PM
I just created a new 64-bit ubuntu 10.04 system with codeblocks 10.05 to continue developing a 3D graphics engine/server that I put aside about 1 year ago. After some futzing, I can get simple new test projects to compile and execute, but I cannot get my 3D engine to compile.

The problem is the following. The compiler appears to compile all the files successfully, but then stops and issues the following error message:

ld cannot find -lX11

I only had the 32-bit implementation of my code working when I stopped developing a year ago, so I need to get that working first. I was developing that on 64-bit ubuntu 9.04 so really nothing significant is different.

As far as I can tell, the problem is this. I installed the xorg-dev package, which installed the 64-bit include files and library files, but not the 32-bit include files and library files. Try as I might, I cannot find any separate package that includes the 32-bit include files and library files. Actually, I assume a single set of include files will support both 32-bit and 64-bit development... but I'm pretty sure I do need to install a set of 32-bit libraries on my computer to compile this application. I did manage to find and install both 32-bit and 64-bit versions of the OpenGL libraries, but I can't find the X11 files.

Is this probably my problem? If so, how do I download and install those 32-bit libraries on my 64-bit ubuntu 10.04 system?

PS: When I stoped developing about 1 year ago, I saved all my development files on an external drive. I just checked, and it does have separate libX11.so libraries (and symbolic links) in the /usr/lib and /usr/lib32 and /usr/lib64 directories.

Dark Photon
08-27-2010, 05:27 PM
ld cannot find -lX11
Do "ls -l /usr/lib/libX11.*". Usually they're in /usr/lib for 32-bit libs. Sometimes /usr/lib32. In the past, /usr/X11R6/lib.

When I've seen that error, I either don't have the base library package installed (e.g. installs /usr/lib/libX11.so.6.3.0) OR I don't have the base library devel package installed (e.g. installs the /usr/lib/libX11.so symlink which points to libX11.so.6.3.0). Both are needed to actually link with the library here using the -lX11 linker option.

Note that 6.3.0 is just an example. The library version suffix on your system may be different.

Also realize that instead of -lX11, you can use the full path to the library (e.g. /usr/libX11.so) in its place. But simpler just to make sure you have the library symlink in place (which typically means just installing the devel package, or creating the symlink in the lib directory yourself).


As far as I can tell, the problem is this. I installed the xorg-dev package, which installed the 64-bit include files and library files, but not the 32-bit include files and library files. ... Is this probably my problem? If so, how do I download and install those 32-bit libraries on my 64-bit ubuntu 10.04 system?
Don't know ubuntu. But on OpenSuSE 11.3, the X11 lib is split into 4 packages, 2 for 32-bit, 2 for 64-bit. With each platform, one for the library only and one for the development files (header, .so symlink, etc.):

xorg-x11-libX11
xorg-x11-libX11-devel
xorg-x11-libX11-32bit
xorg-x11-libX11-devel-32bit

bootstrap
08-27-2010, 05:51 PM
I definitely do have the 64-bit libraries installed --- I see them and the symbolic links to them in the /usr/lib directory.

Also, when I try to download and install the packages you mentioned, apt-get says "couldn't find specified package". So these names are not familiar to ubuntu. Maybe the names you mention are for RPM, while ubuntu packages are .deb (for apt-get or synaptic). But I don't understand how linux packages work (or the applications that download and install them). Amazingly, searching all over the place hasn't yielded an answer to the simple question "where the frack are the 32-bit libX11 libraries!".

Dark Photon
08-28-2010, 01:15 PM
I definitely do have the 64-bit libraries installed --- I see them and the symbolic links to them in the /usr/lib directory.

Also, when I try to download and install the packages you mentioned, apt-get says "couldn't find specified package". So these names are not familiar to ubuntu. Maybe the names you mention are for RPM, while ubuntu packages are .deb (for apt-get or synaptic).
Names are up to the distro to pick.


Amazingly, searching all over the place hasn't yielded an answer to the simple question "where the frack are the 32-bit libX11 libraries!".
We're deep in the land of "this has nothing to do with OpenGL", so I'd suggest your ask question on a Ubuntu forum, linuxquestions.org, ...or just blow away Ubuntu and install OpenSuSE :D