Re: Program exited with code -11 when calling

2020-06-30 Thread Anthony via Digitalmars-d-learn
(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? D strings are generally not null-terminated (except for literals). Before passing them to a C function you need to add a trailing null. Try using

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, &error); 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
et a "Program exited with code -11" message. Does anyone know what I'm doing wrong? D strings are generally not null-terminated (except for literals). Before passing them to a C function you need to add a trailing null. Try using std.conv.toStringz instead of casting the pointer yourse

Re: Program exited with code -11 when calling

2020-06-30 Thread Anthony via Digitalmars-d-learn
amp;error); I get a "Program exited with code -11" message. Does anyone know what I'm doing wrong? Thanks I don't know the exact function you are trying to use, but -11 means "segmentation fault" on linux. This means that your program is trying to read or write a m

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, > &error); > > > I get a "Program exited with

Re: Program exited with code -11 when calling

2020-06-30 Thread Cym13 via Digitalmars-d-learn
son_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&

Program exited with code -11 when calling

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

Re: Program exited with code -11

2019-09-18 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 18 September 2019 at 13:36:30 UTC, Arjan wrote: On Wednesday, 18 September 2019 at 13:22:03 UTC, Danny Arends "Program exited with code -11" Not signal 11? On unix/linux I assume? Same thing. This is a segmentation fault. Compile the program with the -g switch to

Re: Program exited with code -11

2019-09-18 Thread Danny Arends via Digitalmars-d-learn
On Wednesday, 18 September 2019 at 13:36:30 UTC, Arjan wrote: On Wednesday, 18 September 2019 at 13:22:03 UTC, Danny Arends wrote: Hey all, "Program exited with code -11" Not signal 11? On unix/linux I assume? It's on linux yes... No idea if it is a signal or an exi

Re: Program exited with code -11

2019-09-18 Thread Arjan via Digitalmars-d-learn
On Wednesday, 18 September 2019 at 13:22:03 UTC, Danny Arends wrote: Hey all, "Program exited with code -11" Not signal 11? On unix/linux I assume?

Program exited with code -11

2019-09-18 Thread Danny Arends via Digitalmars-d-learn
error: "Program exited with code -11" No other messages, did anyone ever encounter something like this before / got any ideas on how to figure out what is wrong ? Danny

Re: Program exited with code -11

2015-11-26 Thread Alex via Digitalmars-d-learn
On Thursday, 26 November 2015 at 08:15:02 UTC, Rikki Cattermole wrote: You forgot to load the pointers to the functions in the shared library :) https://github.com/DerelictOrg/DerelictSFML2 OMG. I am embarrassed. Thank you very much.

Re: Program exited with code -11

2015-11-26 Thread Rikki Cattermole via Digitalmars-d-learn
uot;dub run" or "dub run --force", I get this: Running ./notquiteciv Program exited with code -11 $ lldb ./notquiteciv (run) Process 81278 launched: './notquiteciv' (x86_64) Process 81278 stopped * thread #1: tid = 0x14dae3, 0x, queue = 'com.apple.main-

Program exited with code -11

2015-11-26 Thread Alex via Digitalmars-d-learn
run --force", I get this: Running ./notquiteciv Program exited with code -11 $ lldb ./notquiteciv (run) Process 81278 launched: './notquiteciv' (x86_64) Process 81278 stopped * thread #1: tid = 0x14dae3, 0x, queue = 'com.apple.main-thread', stop reason = E

Re: Program exited with code -11

2015-06-24 Thread weaselcat via Digitalmars-d-learn
On Wednesday, 24 June 2015 at 07:52:10 UTC, Charles Hawkins wrote: On Wednesday, 24 June 2015 at 06:54:57 UTC, weaselcat wrote: On Tuesday, 23 June 2015 at 06:50:28 UTC, Charles Hawkins wrote: [...] you can instruct dub to use other compilers with the --compiler option valid options include

Re: Program exited with code -11

2015-06-24 Thread Charles Hawkins via Digitalmars-d-learn
On Wednesday, 24 June 2015 at 06:54:57 UTC, weaselcat wrote: On Tuesday, 23 June 2015 at 06:50:28 UTC, Charles Hawkins wrote: On Tuesday, 23 June 2015 at 03:31:37 UTC, weaselcat wrote: On Tuesday, 23 June 2015 at 03:29:14 UTC, Charles Hawkins wrote: [...] Try to compile with either ldc or gd

Re: Program exited with code -11

2015-06-23 Thread weaselcat via Digitalmars-d-learn
On Tuesday, 23 June 2015 at 06:50:28 UTC, Charles Hawkins wrote: On Tuesday, 23 June 2015 at 03:31:37 UTC, weaselcat wrote: On Tuesday, 23 June 2015 at 03:29:14 UTC, Charles Hawkins wrote: [...] Try to compile with either ldc or gdc and the -g flag, it should give you a backtrace. dmd seems

Re: Program exited with code -11

2015-06-23 Thread Charles Hawkins via Digitalmars-d-learn
On Tuesday, 23 June 2015 at 11:18:07 UTC, anonymous wrote: On Tuesday, 23 June 2015 at 07:57:26 UTC, Charles Hawkins wrote: Sigh. I'm probably doing something stupid. I tried full paths: dmd -I+/home/charles/projects/d/mylib/source/mylib/ myprog.d What's that plus sign doing there? Looks w

Re: Program exited with code -11

2015-06-23 Thread anonymous via Digitalmars-d-learn
On Tuesday, 23 June 2015 at 07:57:26 UTC, Charles Hawkins wrote: Sigh. I'm probably doing something stupid. I tried full paths: dmd -I+/home/charles/projects/d/mylib/source/mylib/ myprog.d What's that plus sign doing there? Looks wrong. /home/charles/projects/d/mylib/build/libmylib.a Same

Re: Program exited with code -11

2015-06-23 Thread Charles Hawkins via Digitalmars-d-learn
Try to compile with either ldc or gdc and the -g flag, it should give you a backtrace. dmd seems to not like linux wrt backtraces. ...I haven't had any success in compiling with anything but dub. gdc, dmd, rdmd always give me "module mylib is in file 'mylib.d' which cannot be read" on my "im

Re: Program exited with code -11

2015-06-23 Thread Baz via Digitalmars-d-learn
On Tuesday, 23 June 2015 at 07:25:05 UTC, Baz wrote: in dmd you have to pass - the .lib/.a files a source I meant "as source", actually. you pass the .lib or .a file without switch as if it's a main source.

Re: Program exited with code -11

2015-06-23 Thread Charles Hawkins via Digitalmars-d-learn
Ok, I think I've answered my own question. dub -v tells me what I need to know. Looks like I need to do a separate compile & link, make file like, just like the old days, or have a very complicated command line. However, if there is a simple way to do the above, which it seems there should b

Re: Program exited with code -11

2015-06-23 Thread Charles Hawkins via Digitalmars-d-learn
On Tuesday, 23 June 2015 at 07:25:05 UTC, Baz wrote: On Tuesday, 23 June 2015 at 06:50:28 UTC, Charles Hawkins wrote: On Tuesday, 23 June 2015 at 03:31:37 UTC, weaselcat wrote: On Tuesday, 23 June 2015 at 03:29:14 UTC, Charles Hawkins wrote: Thanks, Adam. I'm coming from OCaml and haven't seen

Re: Program exited with code -11

2015-06-23 Thread Baz via Digitalmars-d-learn
On Tuesday, 23 June 2015 at 06:50:28 UTC, Charles Hawkins wrote: On Tuesday, 23 June 2015 at 03:31:37 UTC, weaselcat wrote: On Tuesday, 23 June 2015 at 03:29:14 UTC, Charles Hawkins wrote: Thanks, Adam. I'm coming from OCaml and haven't seen a seg fault in years. Didn't recognize it. :D Hope

Re: Program exited with code -11

2015-06-22 Thread Charles Hawkins via Digitalmars-d-learn
On Tuesday, 23 June 2015 at 03:31:37 UTC, weaselcat wrote: On Tuesday, 23 June 2015 at 03:29:14 UTC, Charles Hawkins wrote: Thanks, Adam. I'm coming from OCaml and haven't seen a seg fault in years. Didn't recognize it. :D Hopefully I can figure it out from here. Try to compile with either

Re: Program exited with code -11

2015-06-22 Thread weaselcat via Digitalmars-d-learn
On Tuesday, 23 June 2015 at 03:29:14 UTC, Charles Hawkins wrote: Thanks, Adam. I'm coming from OCaml and haven't seen a seg fault in years. Didn't recognize it. :D Hopefully I can figure it out from here. Try to compile with either ldc or gdc and the -g flag, it should give you a backtrace

Re: Program exited with code -11

2015-06-22 Thread Charles Hawkins via Digitalmars-d-learn
Thanks, Adam. I'm coming from OCaml and haven't seen a seg fault in years. Didn't recognize it. :D Hopefully I can figure it out from here.

Re: Program exited with code -11

2015-06-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 23 June 2015 at 02:45:24 UTC, Adam D. Ruppe wrote: 128 == -1 I'm sorry, I need to stop posting these things without thinking. -1 is actually 255 when you cast it, but I'm pretty sure the shell just does that subtraction from 128 because of the signal reservation codes. I stand by

Re: Program exited with code -11

2015-06-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 23 June 2015 at 02:34:17 UTC, Charles Hawkins wrote: How do I find out what that means? Many return codes have a meaning in the linux documentation: http://www.tldp.org/LDP/abs/html/exitcodes.html#EXITCODESREF (it lists them as unsigned, but you got a signed result. 128 == -1, so

Program exited with code -11

2015-06-22 Thread Charles Hawkins via Digitalmars-d-learn
My first attempt at a significant D program and I'm getting: Error executing command run: Program exited with code -11 How do I find out what that means?