Hi,I seem unable to pass an array of strings successfully, despite trying to replicate what the documentation is telling atand I did not find reports of anyone with a similar issue.The C code is in a file test.c:#include <stdio.h>void foo(const int argc, const char **argv) {int i;const char *string;for (i = 0; i < argc; i++) {string = argv[i];printf(" %i: %s\n", i, string);}}The Julia code is:lib = dlopen("test")argv = ["abc", "def"] # type is Array{ASCIIString,1}res = ccall(dlsym(lib, :foo), Void,(Int, Ptr{Ptr{Uint8}}), length(argv), argv)No error occurs, but the outcome on the console is:0: �;W1: �;W(There char** is not received properly on the C end, although the int is).The Julia version is the latest release: Version 0.0.0+99218429.r0431, commit 04315b1d1e (2012-10-14 14:19:35).Any hint or pointer would be greatly appreciated.Laurent--
--
argv = ["abc", "def"]
argv_p = map((x)->pointer(x.data), argv)
res = ccall(dlsym(lib, :foo), Void, (Int, Ptr{Ptr{Uint8}}), length(argv), argv_p)
...but in a sense that leaves the responsibility of taking care of some of the memory management to a Julia programmer. Not ideal. An alternative would be to let one do this at the C level, but that would make the interfacing with C code require the writing of C code (an interface layer with the C library).
Hmm, I thought I implemented this. I would not have put it in the doc otherwise. I'll take a look.
--
--
--
--