开发者

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

开发者 https://www.devze.com 2023-01-06 21:48 出处:网络
Is th开发者_运维问答ere any function to import a C library (.so) file in the Solaris operating system?

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

精彩评论

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