-   Ubuntu (
-   -   File Differences between libncurses and lib32ncurses (

cmnorton 10-01-2009 11:12 AM

File Differences between libncurses and lib32ncurses
I have 64 and 32-bit libncurses installed. I am having a linking problem, and need to point to libn32ncurses.

What is the difference between the 64 and 32-bit files (differences in name), so I can set my load library environment variables correctly?

shahkent 10-01-2009 03:00 PM

Not to sound redundant, but the 64-bit version of libncurses is specifically intended for 64-bit applications, so you can't link to or compile a 32-bit application using this version of libncurses. Based on your description, you are trying to link a 32-bit application.

Since you have both versions of installed, then you can get around the linking problem as follows:

1. Let's say that the 32-bit libncurses file on your system is called and that the file is located in the /usr/lib directory. You can create a soft-link to this file as follows:

cd /usr/lib
ln -s

This should satisfy the linker when it looks for, assuming that the /usr/lib directory is in your LD_LIBRARY_PATH environment variable.

If you have a pre-compiled binary (let's call it myprog) that requires this library, then you can check to see if the linker is satisfied by using the ldd command:

ldd myprog

The linker should show you which libraries it is able to find. should appear in the output. Here's an example for vi from my machine:

$ ldd /usr/bin/vim => /usr/lib64/ (0x0000003e8cb00000) => /lib64/ (0x0000003e8d300000) => /lib64/ (0x0000003e8c900000) => /usr/lib64/ (0x0000003e8cf00000) => /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE/ (0x0000003e8db00000) => /lib64/tls/ (0x0000003e8c500000) => /lib64/ (0x0000003e8eb00000) => /lib64/tls/ (0x0000003e8c000000) => /lib64/ (0x0000003e8c300000) => /lib64/tls/ (0x0000003e8c700000) => /lib64/ (0x0000003e8d500000) => /lib64/ (0x0000003e8cd00000) => /lib64/ (0x0000003e90900000) => /lib64/ (0x0000003e8d900000)
/lib64/ (0x0000003e8be00000)

Notice that on my machine, vi was compiled against the 64-bit version of libncurses (I have the 64-bit version of Redhat installed on this machine) which is located in the /usr/lib64/ directory.

I hope that this info helps.


All times are GMT -5. The time now is 11:49 PM.