First of all, here is the list of that I'm using to develop in Java:
- OS=Windows 10 64 bits
- Using Eclipse to develop in Java (Eclipse "Kepler")
- Using Java Runtime JRE 1.8.0_91 64 bits
And this is what my coworker is using to develop in C
- OS=Windows 10 64 bits
- Microsoft Visual Studio 2015
Well, my coworker has developed some code in C and using OpenCascade. I'm trying to use JNI to use what he developed. I already know how to use JNI, since I run a few basic examples (how to create de ".h" file using "javah", how to include that file when compiling the C code in Visual Studio, how the Java methods must match some methods in the ".h" file which must match some funcions in the C code, etc). When my coworker gave me an initial simple code in C, I was able to call one of his simple C methods from JNI, so I think I already know the basics about how to use JNI.
The problem started when he started using OpenCascade in his C code. This is what I get, and it happens with the System.loadLibrary(NEInterface3D) method:
java.lang.UnsatisfiedLinkError: Z:\Brian\NestingBusiness\Archivos\NEInterface3D.dll: Can't find dependent libraries
The problem is NOT that JNI can not find the file "NEInterface3D.dll" which is the main DLL, but that some libraries can not be found. What libraries exactly? I don't know.
I already used "Dependency Walker" (http://www.dependencywalker.com) and I see a tonelade of files that seems to be missing, most of them in the form "API-MS-WIN-**************" which, according to what I read somewhere, is a false alarm. That is very misleading.
Here are my questions:
- How can I know exactly what files are missing when I get the Java exception java.lang.UnsatisfiedLinkError?
- How can I know exactly what are ALL the libraries what are "missing"? Are those DLLs, or maybe something else?
- Where do I get all those missing files from?
- Where do I have to place all those missing files, how do I tell Java/JNI where they are? I'm already using this to tell Java/JNI where is the main ".dll" file and it works: -Djava.library.path="(Windows path)"
I'm very seasoned with Java, but I'm not a C developer. I'm in charge of the integration and that includes using Visual Studio to generate the ".dll" file, so I had to learn how to do that. I think I'm doing it correctly, I'm including all the files that are required according to my coworker (the C developer) so the ".dll" generation seems to have been successful. But the problem takes place with the System.loadLibrary() method, as I described.
Thanks in advance,