-
Notifications
You must be signed in to change notification settings - Fork 591
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
Function pointer returning shared_ptr #720
Comments
JavaCPP needs a FunctionPointer peer class |
Sure. The problem, if I understood well, is the |
Right, so where is that FunctionPointer class? |
@Properties(inherit = presets.P.class)
public class S_F extends FunctionPointer {
static { Loader.load(); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public S_F(Pointer p) { super(p); }
protected S_F() { allocate(); }
private native void allocate();
public native @SharedPtr S call();
} That's the class automatically generated by the parser from the C++ code above. |
You'll need to add at least a |
public native @Cast({"", "std::shared_ptr<S>"}) @SharedPtr S call(); seems to work. Thanks. Do we close this issue or keep it open in case there is something to fix to avoid this |
We need to specify the type somehow. As I've mentioned somewhere before, think of |
|
No, it doesn't, for example, see issue #717 |
In #717 the |
The JNI cannot compile with:
Because the generated class:
has a function returning
S*
instead ofstd::shared_ptr<S>
.The text was updated successfully, but these errors were encountered: