Greetings, I hope someone has the patience to read this. I have a setup at hand, which is slightly confusing me. I have a C source code directory generated by an Eiffel Compiler. I want to use this output from Java, so I need a DLL for JNI, in which I'll implement some JNI functions. When I compile the C code, it gives me a static library, which has dependencies to some other libraries. So my setup is:
myDLL.dll (C++) [depends on --> staticLib.lib [depends on --> (sharedlib1, sharedlib2...)
My C++ project is compiled with Eclipse CDT, and I end up with 1 dll. I can use this DLL from Java without any problems It only needs one other dll in the path during execution. All the code from the static library is compiled into my dll, and Java JNI calls to my DLL in turn uses this code.
I wanted to use the same DLL from another C++ project. However, when I link only to DLL, the linker complains about not finding a particular symbol. This symbol is declared in the static library as extern, so it must be somewhere in one of the dependencies of the static library.
The only way I could link and compile the DLL to a C++ project is also by linking to static library, which was included in the DLL in the first place. So I end up with an .exe, that is containing the static library twice: one in the DLL, the other within the exe.
Since Java code successfully uses the DLL, I know that static library is compiled into DLL, but I can't avoid including it twice in my C++ app. I'm also nervous about including the same library twice. How are things handled during runtime? Can this bite me in an unexpected way?
Your recommendations to manage this setup would be much appreciated.
Best Regards
Seref