Load shared library by path at runtime

后端 未结 4 1158
青春惊慌失措
青春惊慌失措 2020-12-05 05:04

I am building a Java application that uses a shared library written in C++ and compiled for different operating systems. The problem is, that this shared library itself depe

4条回答
  •  粉色の甜心
    2020-12-05 05:34

    On Windows, you can use LoadLibrary, and on Linux, dlopen. The APIs are extremely similar and can load a so/dll directly by providing the full path. That works if it is a run-time dependency (after loading, you "link" by calling GetProcAddress/dlsym.)

提交回复
热议问题