-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parser mapping #714
Comments
Another question is how can I build a class like how they are built in the ffmpeg wrapper? Like there the classes look like this : for example the avutil folder with classes inside it that all have this annotation @properties(inherit = org.bytedeco.ffmpeg.presets.avutil.class) |
It will do that by default as long as you include the header file containing the typedef for WindowContext.
You'll need to specify a global class in addition to a target package, just like the presets for FFmpeg, yes: |
I had another comment before this but I fixed everything for the most part. The problem actually had to do with the DLLEXPORT define. the define looks like this : #define DLLEXPORT __declspec(dllexport). After I removed the define and just used __declspec(dllexport) it worked. Any way around that? Also now I am doing it like it is with the ffmpeg wrapper but I wonder how do you build the dlls? Because now I have multiple classes, do I have to give them to the parser one by one to build? edit: by the way do the constructors and destructors of the classes I am parsing need to be marked with __declspec(dllexport) ? Because the compiler seems to be complaining about that. |
The C++ compiler on Windows do need those, but JavaCPP doesn't, we can tell it to ignore them: |
yup, that did the job. What about the dlls though? I have a couple of classes the mapper parsed and now I need to run the command java -jar javacpp. path/to/class/Class.java |
If you want to pass a source file like that, yes, it supports only a single file at a time. |
not a source file , what I mean is right now when I parse my header files java classes are generated from the classes in the header files. Do I need to run the parser on these java classes as well? |
We need to run the builder on those classes as well yes: |
Right, probably with some sort of script. I think I read about that somewhere too. Last thing I am concerned about is I had to dllexport my native constructors and destructors, any idea why that might be? For these classes I have disabled the copy constructor: WindowContext(const WindowContext&) = delete;
WindowContext& operator =(const WindowContext&) = delete;
(WindowContext is one of the classes I had to export the constructor and destructor for the parser to not throw a linking error) |
and here is an image of the linking errors if it helps |
You'll need to link with the libraries containing those symbols. |
I have done that. Those symbols are contained within a DLL that I link but I still don't understand if I need to make them callable from a program that imports the dll or leave them as internal functions of the dll. |
I have a question about the javacpp parser or rather how to map this properly. I read up on the mapping recipes but I either missed it, it went over my head or it isn't there(probably one of the first two). I have a function that pretty much just allocates an object on the heap and returns the pointer to that object. The function looks like this :
DLLEXPORT lve::WindowContext* VideoContext::alloc_window_context();
When I give the parser the header it generates a class that extends FunctionPointer called Int_Alloc_window_context and the function ends up looking like this :
how can I tell it to make the return type WindowContext?
The text was updated successfully, but these errors were encountered: