tags:

views:

311

answers:

1

Hi, i'm trying to write jna mapping for libfaad2. The library uses mp4ff for parsing mp4 files. mp4ff is compiled into libmp4ff.lib on windows and libmp4ff.a on linux. JNA only looks for .dll/.so files. So how can I load this mp4ff into jna?

EDIT

I think this question has the answer. I hate AAC, I've spent 4 days debugging invalid memory access with ffmpeg, now libfaad uses some weird libraries. :(

A: 

I think that you are right that the answer in this is relevant here. On UNIX-type systems, .a files are a special type of archive, holding a library that can only be statically linked into an application (it sounds like a .lib file is the same thing on Windows). That means that there is no way to load that library at runtime, as you will need a dynamic library. But know that this isn't a limitation of JNA, it is a general limitation of how most operating systems work.

Static libraries become "part" of a resulting executable (or library) whereas dynamic libraries can be loaded at runtime. There are advantages and disadvantages of each (for example, static libraries make an application more self-sufficient by not relying on other libraries being present and in the correct versions, but dynamic libraries can save both space on disk and memory as well as a single file to update if there are security or other bugfix patches). Most software that I have seen can be compiled to both a static or dynamic (shared) library, so I would be surprised if you couldn't find what you are looking for somewhere (or compile it yourself).

Adam Batkin
Thanks for the answer. I've compiled a dll and it works.
tulskiy