I have a third-party VC++ based DLL I want to use in a Java project, along with its header. I figured out BridJ is a good solution for this, but the header is so complex that JNAerator chokes at it and just freezes at 100% CPU, finally bailing out with OutOfMemoryError: Java heap space
. So I have to write the bindings for the needed things from the header myself.
Now, I have to guide BridJ via annotations. For this, I looked at the header and I found a part looking like the following which I do not understand:
namespace SomeNamespace {
class SomethingStrange TheClass {
public:
TheClass();
// more
}
}
So, what I want to know: What does SomethingStrange
mean here? Is this another child namespace? And how do I wire this up correctly in BridJ?
When building a DLL, SomethingStrange
will boil down to __declspec(dllexport)
.
When using that DLL, it will boil down to __declspec(dllimport)
.
They allow a class declaration to be used by both the author and users of a particular DLL.
What they "boil down to" is normally controlled by compiler flags controlled via the project settings.