Re: Program exited with code -11 when calling

2020-07-01 Thread Anthony via Digitalmars-d-learn
On Wednesday, 1 July 2020 at 05:47:16 UTC, Anthony wrote: On Wednesday, 1 July 2020 at 05:33:48 UTC, H. S. Teoh wrote: On Wed, Jul 01, 2020 at 05:04:28AM +, Anthony via Digitalmars-d-learn wrote: [...] auto str_utf8 = str.toUTF8(); bson_error_t error auto bson =

Re: Program exited with code -11 when calling

2020-06-30 Thread Kagamin via Digitalmars-d-learn
bson_t* bson_new_from_json(in char* data, long len, bson_error_t* error); string str_utf8 = "{\"a\":1}"; bson_error_t error; auto bson = bson_new_from_json(str_utf8.ptr, str_utf8.length, ); You have a wrong declaration for bson_error_t too.

Re: Program exited with code -11 when calling

2020-06-30 Thread Anthony via Digitalmars-d-learn
On Wednesday, 1 July 2020 at 05:33:48 UTC, H. S. Teoh wrote: On Wed, Jul 01, 2020 at 05:04:28AM +, Anthony via Digitalmars-d-learn wrote: [...] auto str_utf8 = str.toUTF8(); bson_error_t error auto bson = bson_new_from_json(cast(const uint8_t*)str_utf8.ptr, -1, ); I get a "Program

Re: Program exited with code -11 when calling

2020-06-30 Thread Anthony via Digitalmars-d-learn
On Wednesday, 1 July 2020 at 05:09:47 UTC, Cym13 wrote: On Wednesday, 1 July 2020 at 05:04:28 UTC, Anthony wrote: 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) {

Re: Program exited with code -11 when calling

2020-06-30 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jul 01, 2020 at 05:04:28AM +, Anthony via Digitalmars-d-learn wrote: [...] > auto str_utf8 = str.toUTF8(); > bson_error_t error > > auto bson = bson_new_from_json(cast(const uint8_t*)str_utf8.ptr, -1, > ); > > > I get a "Program exited with code -11" message. > Does anyone know what

Re: Program exited with code -11 when calling

2020-06-30 Thread Cym13 via Digitalmars-d-learn
On Wednesday, 1 July 2020 at 05:04:28 UTC, Anthony wrote: 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*

Program exited with code -11 when calling

2020-06-30 Thread Anthony via Digitalmars-d-learn
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,