Hi, I have a problem trying to call a C library using JNA (on a windows platform, using vscode).
I grabbed a copy of the ffmpeg shared libraries from: https://www.gyan.dev/ffmpeg/builds/
specifically: https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full-shared.7z
I took the contents of the bin sub-directory and put it in the 'lib' directory of my clojure project. I also added this directory to my path and could happily call the ffmpeg app.
Here is the contents of my deps.edn:
{:deps
{net.java.dev.jna/jna {:mvn/version "5.6.0"}}
:paths ["src" "lib"]
}
And here is the code:
(ns jnatest)
(import (com.sun.jna Native Pointer))
(gen-interface
:name jna.lib_avformat
:extends [com.sun.jna.Library]
:methods [[avformat_alloc_context [] Pointer]])
(def avformat
(Native/loadLibrary "avformat-58" jna.lib_avformat))
On the the call to Native/loadLibrary I get the error:
; Execution error (UnsatisfiedLinkError) at com.sun.jna.Native/open (Native.java:-2).
; %1 is not a valid Win32 application.
I initially started with the techascent jna implementation, https://clojars.org/techascent/tech.jna, and had similiar issues, so I went back to basics.
I'm guessing it's something wrong with the libraries, but before I start recompiling all the ffmpeg libraries I thought I'd ask if there might be something simple to try.
Any hints appreciated.