开发者

Using Perl on Solaris, how do I import a C (.so) library?

Is th开发者_运维问答ere 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.


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.


Try C::DynaLib.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜