Program exited with code -11 when calling

Anthony anthoq88 at gmail.com
Wed Jul 1 05:04:28 UTC 2020


I'm trying to convert this c function:

bson_t *bson_new_from_json (const uint8_t *data, ssize_t len, 
bson_error_t *error);


Into a D function. This is my attempt:
extern(C) {
     struct bson_t;
     struct bson_error_t;

     bson_t* bson_new_from_json(const uint8_t* data, long len, 
bson_error_t* error);
}

However when I try it, for example:

auto str_utf8 = str.toUTF8();
bson_error_t error

auto bson = bson_new_from_json(cast(const uint8_t*)str_utf8.ptr, 
-1, &error);


I get a "Program exited with code -11" message.
Does anyone know what I'm doing wrong?

Thanks



More information about the Digitalmars-d-learn mailing list