You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am attempting to use CxxWrap to expose a C++ library to Julia, and I would like to pass a Julia function as a callback to the library. However, when I attempt to use jlcxx::make_function_pointer, I receive an error that some of the arguments of the signature for the function pointer I'm attempting to convert have no Julia wrapper. A MWE is below:
#include"jlcxx/jlcxx.hpp"
#include"jlcxx/functions.hpp"classtest_class {
};
JLCXX_MODULE define_julia_module(jlcxx::Module& mod) {
mod.method("pass_func",[](jlcxx::SafeCFunction f_data) {
auto f = jlcxx::make_function_pointer<void(int*,test_class*)>(f_data);
});
}
julia>module wrapped
using CxxWrap
@wrapmodule(joinpath("lib/path","lib"))
function__init__()
@initcxxendend
julia>functiontestfunc(i::Int,c::wrapped.test_class)
end
julia> cxxtestfunc =@safe_cfunction(testfunc, Cvoid, (CxxPtr{Cint},CxxPtr{wrapped.test_class}));
julia> wrapped.pass_func(cxxtestfunc)
ERROR: Type Pi has no Julia wrapper
This error does not arise if a double* is specified in the function pointer signature, which makes me think this is a bug, or am I just using libcxxwrap incorrectly?
The text was updated successfully, but these errors were encountered:
Hi, I am attempting to use
CxxWrap
to expose a C++ library to Julia, and I would like to pass a Julia function as a callback to the library. However, when I attempt to usejlcxx::make_function_pointer
, I receive an error that some of the arguments of the signature for the function pointer I'm attempting to convert have no Julia wrapper. A MWE is below:This error does not arise if a
double*
is specified in the function pointer signature, which makes me think this is a bug, or am I just using libcxxwrap incorrectly?The text was updated successfully, but these errors were encountered: