rbranson/node-ffi — Issue #38: Unable to load any libraries without extension
Author: raphaelr
Created: 2012-03-09 12:08:32+00:00
State: open

node-ffi is unable to load libraries which don't end with PLATFORM_LIBRARY_EXTENSIONS[process.platform].
For example, the libpcap library is called 'libpcap.so.1.1.1' on my system. I can't load the library with
`new ffi.Library('libpcap.so.1.1.1', ...)`, because node-ffi appends '.so' in [library.js#11](https://github.com/rbranson/node-ffi/blob/master/lib/library.js#L11) and tries to load `libpcap.so.1.1.1.so`.

There is no workaround other than to change the code.

One way to fix this issue without breaking backwards compatibility would be to check if `libfile + EXT` exists, if it doesn't, remove the `EXT` and try again. Any thoughts on that?