Reputation: 7
Is there a way to import a C++ ".lib" into java, using either the androind NDK, or the Java JNI? I do not have the source code to create a dll. which I am aware would provide a way to import into java, however I have not found a way to convert the ".lib" file to a .dll.
Thank you in advance for any thoughts.
Note: The library is a windows ".lib" compiled in C++
Upvotes: 1
Views: 763
Reputation: 1753
You can start looking at 2 of the many examples that comes with the Android tools, have a particular look for the 2 samples about the use of some external C/C++ libraries that comes with the Android NDK.
Anyway you can't run X86 assembly code on an ARM and viceversa, so the fact that you can use external C++ does not bypass the limit of the targeted architecture by your libraries, to do this you better have the source code for those C++ libraries.
Upvotes: 0
Reputation: 16718
You can't use a Windows/MSVC .lib file with the Android NDK (even if you could, it'd be x86 and most Android devices are ARM). You will need to compile the library from source.
Upvotes: 1