how to access a method of C++ library (DLL) from Java

前端 未结 2 675
野的像风
野的像风 2020-12-19 16:18

I have a library which is written in C++ (actually a Firefox plugin, xyz.dll) and I need to access its methods from Java.

public class AccessLibrary {
    p         


        
2条回答
  •  太阳男子
    2020-12-19 16:46

    I think your native library needs to provide a C-style interface, for example

    __declspec( dllexport ) void showVersion() {
      /* ... */
    }
    

    Ideally, take a look at your DLL with depends.exe (which is available through the Windows SDK), there you'll see if your DLL provides the correct function exports.

提交回复
热议问题