tags:

views:

64

answers:

3

Is there any function to import a C library (.so) file in the Solaris operating system?

In Windows I can use Win32::API, how about Solaris?

Thank you.

A: 

If by import you mean just link against it, you can use -l followed by the base name of the library on the cc/gcc/ command line when linking. For example, to link to libfoo.so, use -lfoo.

If by import you mean dynamically load at runtime, lookup the dlopen and dysym functions.

R..
Question is about Perl.
el.pescado
Then why was it tagged C? Grrr...
R..
Because ist subject is importing C libraries in Perl.
el.pescado
+1  A: 

XSLoader looks to be the simple interface.

DynaLoader looks to be the more complex interface.

But your modules have to be tailored to be imported into Perl; the SWIG toolkit may be the best tool to marshal data between native C and native Perl.

sarnold
The majority uses [XS](http://en.wikipedia.org/wiki/XS_%28Perl%29) instead of SWIG.
daxim
+1  A: 

Try C::DynaLib.

el.pescado