I tried the following, it compiles OK and runs OK, but it appears the julia 
function is not called (because there is no output from the println 
statement).  What is wrong?

#include <julia.h>
> #include <iostream>
> using namespace std;
> struct TestType {
>     double a;
>     double b;
> };
> int main(int argc, char *argv[])
> {
>     TestType A, *ret;
>     A.a=2.;
>     A.b=3.;
>     jl_init(NULL);
>     jl_load("TestArg.jl");
>     jl_value_t * mod = (jl_value_t*)jl_eval_string("TestArg");
>     jl_function_t * func = jl_get_function((jl_module_t*)mod,"TestFunc");
>     jl_call1(func, (jl_value_t *)&A);
>     jl_atexit_hook(0);
>     return 0;
> }
> # TestArg.jl
> module TestArg
> type TestType
>     a::Float64
>     b::Float64
> end
> function TestFunc(data::TestType)
>     println("in TestArg.TestFunc ")
> end
> end


Reply via email to