# linux shared libraries



## H010d (Jun 25, 2009)

Hello, guys!!
Does anybody know if there's a way to use linux shared libraries in application compiled under FreeBSD?
I need to use oracle instant client but Oracle doesn't provide native libraries for FreeBSD.


----------



## vivek (Jun 25, 2009)

Have you tried out Linux binary compatibility mode? It support Oracle client. See tutorial

http://www.freebsd.org/doc/en/books/handbook/linuxemu.html


----------



## SirDice (Jun 25, 2009)

I think the OP knows about the linux compatibility. If I read his question correctly the OP wants to know how you can use linux libraries (like the ones that come with the oracle client) in native freebsd applications.


----------



## H010d (Jun 26, 2009)

> I think the OP knows about the linux compatibility. If I read his question correctly the OP wants to know how you can use linux libraries (like the ones that come with the oracle client) in native freebsd applications.



That's exactly what I need.


----------



## vivek (Jun 26, 2009)

H010d said:
			
		

> That's exactly what I need.



Did you even bothered to read the link provided in my first post? It has chapter about Oracle and install Linux shared libs...


----------



## H010d (Jun 26, 2009)

Sorry for my English, it's not my native language.
*2vivek*
Yes, I had read that link before I posted my question.
There's no problem to install oracle instant client port or any other linux shared libs.
And there's no problem to run linux applications that requires linux shared libs in compatibility mode.

The question was is it possible to use linux shared libs in native FreeBSD application that I compile by myself under FreeBSD. If yes, what should I do?

When I try to link I get the following errors:

```
/usr/bin/ld: warning: libnnz10.so, needed by /compat/linux/usr/lib/oracle/10.2.0.3/client/lib/libclntsh.s
o, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libdl.so.2, needed by /compat/linux/usr/lib/oracle/10.2.0.3/client/lib/libclntsh.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libm.so.6, needed by /compat/linux/usr/lib/oracle/10.2.0.3/client/lib/libclntsh.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libpthread.so.0, needed by /compat/linux/usr/lib/oracle/10.2.0.3/client/lib/libclntsh.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libnsl.so.1, needed by /compat/linux/usr/lib/oracle/10.2.0.3/client/lib/libclntsh.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libc.so.6, needed by /compat/linux/usr/lib/oracle/10.2.0.3/client/lib/libclntsh.so, not found (try using -rpath or -rpath-link)
```

If I update LD_LIBRARY_PATH to include /usr/compat/linux/lib/
I get warning


> /usr/bin/ld: warning: libc.so.6, needed by /usr/compat/linux/usr/lib/oracle/10.2.0.3/client/lib/libclntsh.so, may conflict with libc.so.7



I found relative thread that mentioned the same problems that were not solved
http://forums.freebsd.org/showthread.php?t=3539


----------

