<div dir="ltr"><div>If code is created for libudev (on Linux) with the  command:</div><div><br></div><div><div>    jextract --source -l udev --include-function udev_new /usr/include/libudev.h</div><div><br></div></div><div>the resulting code fails at run-time with:</div><div><br></div><div>java.lang.UnsatisfiedLinkError: no udev in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib</div><div><br></div><div>That's of course correct as the libudev is in /usr/lib/x86_64-linux-gnu. But it isn't just a random application specific directory. It's a directory that is searched for libraries by default (depending on the architecture the name changes) and contains many basic libraries for Linux.</div><div><br></div><div>The generated code can be fixed easily with a minor modification. Instead of the generated code (in RuntimeHelper.java):</div><div><br></div><div>        System.loadLibrary("udev");<br>        SymbolLookup loaderLookup = SymbolLookup.loaderLookup();</div><div><br></div><div>one can just put:</div><div><br></div><div>        SymbolLookup loaderLookup = SymbolLookup.libraryLookup("libudev.so", MemorySession.openImplicit());</div><div><br></div><div>Would it be possible to add an option to jextract so it generates code using SymbolLookup.libraryLookup() instead of SymbolLookup.loaderLookup() and does not generate a call to System.loadLibrary()?</div><div><br></div></div>