# Shared libraries error ( Linux apps from ports )



## sideburn (May 4, 2009)

Hello BSDers! :e

I've installed aim (instant messenger) from FreeBSD's port.  It requires linux compat.  This is my first time to try to run linux apps on FreeBSD.  After the installation,  I found aim on several directories:

```
./usr/compat/linux/bin/aim
./usr/compat/linux/usr/bin/aim
./usr/compat/linux/usr/lib/aim
```

I tried to execute aim by entering:

```
./aim
```
It outputs using wrong library (brandelf = FreeBSD):

```
/compat/linux/usr/bin/aim: error while loading shared libraries: /usr/local/lib/libXi.so.6: ELF file OS ABI invalid
```

I see there is another libXi.so.6 ( brandelf = Linux ) listed under:

```
./usr/compat/linux/usr/X11R6/lib/libXi.so.6
```

How do I instruct it to use

```
/usr/compat/linux/usr/X11R6/lib/libXi.so.6
```
instead of

```
/usr/local/lib/libXi.so.6
```

Thanks!!!


----------



## vivek (May 4, 2009)

Use ldconfig command configure the shared library cache. To list current cache enter:

```
ldconfig -r | less
ldconfig -r | grep -i something.so
```
Read man page for the details.


----------



## sideburn (May 5, 2009)

Thanks vivek!

I have read man page for *ldconfig* and don't understand most of it (I'm a few weeks old newbie coming from windows)...I've searched 'ldconfig' in this forum and via google and found very little examples.  So far, I've tried:


```
ldconfig -r | grep libXi
```
It outputs

```
160:-lXi.6 => /usr/local/lib/libXi.so.6
	480:-lXi.6 => /usr/compat/linux/usr/X11R6/lib/libXi.so.6
```
Also, I tried:

```
# ldconfig -m /usr/local/lib
# ldconfig -m /usr/compat/linux/usr/X11R6/lib
```
But still no luck...can you give me an example how to use ldconfig?

Thanks!:e


----------



## sideburn (May 6, 2009)

Mmmm... when I view /usr/compat/linux/etc/ld.so.conf , it outputs:

```
include ld.so.conf.d/*.conf
/lib
/usr/lib
/usr/local/lib
```
Should I replace this line:

```
/usr/local/lib
```
with this line:

```
/usr/compat/linux/usr/X11R6/lib/
```
I don't know what I am doing lol!


----------



## sideburn (May 6, 2009)

I found another alternative AIM client in FreeBSD ports called pidgin. It works!  It looks like it will work with about 16 different Instant Messengers into one such as MSN, AIM, Google Talk, Gadu-Gadu, ICQ, Yahoo, etc.


----------



## DutchDaemon (May 6, 2009)

I was going to suggest Pidgin, but thought it might be overkill if you just wanted AIM. But of course 'make config' gives you the choice.


----------

