Hi,
I've just tried to make a binary which accepts command line arguments and I get segfaults which has led me to notice:
In hello.jl:
Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
println("hello, world")
@show f()
println(lineplot(1:10, (1:10).^2))
return 0
end
So I should expect to accept ARGS and pass it through to use with say ArgParse.jl.
However, when I look at program.c:
int main(int argc, char *argv[])
{
intptr_t v;
// Initialize Julia
uv_setup_args(argc, argv); // no-op on Windows
libsupport_init();
jl_options.image_file = "libhello";
julia_init(JL_IMAGE_CWD);
// Do some work
julia_main();
// Cleanup and graceful exit
jl_atexit_hook(0);
return 0;
}
Nothing is passed to julia_main when it is invoked - perhaps why I'm getting segfault!? So does the call of julia_main() need to be altered to accept some arguments? If so, how?