Reputation: 89
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.
Upvotes: 0
Views: 217
Reputation: 104080
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.
Upvotes: 1
Reputation: 215517
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.
Upvotes: -1