Re: request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread anonymouse via Digitalmars-d-learn
On Friday, 19 May 2023 at 12:40:29 UTC, Danny Arends wrote: On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote: What am I doing wrong here? [SNIP] You're running the whole thing in a while(TRUE) loop, recreating the curl object re-initiating the transfer and file pointer, etc. The

Re: Can dmd compile a favicon.ico to exe file ?

2023-05-19 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 19/05/2023 9:39 PM, John Xu wrote: On Thursday, 18 May 2023 at 15:39:05 UTC, Richard (Rikki) Andrew Cattermole wrote: On 19/05/2023 2:19 AM, John Xu wrote: On Monday, 15 May 2023 at 03:54:03 UTC, Richard (Rikki) Andrew Cattermole wrote: That is only for OMF target. You need rc that

Re: Lockstep iteration in parallel: Error: cannot have parameter of type `void`

2023-05-19 Thread Ali Çehreli via Digitalmars-d-learn
On 5/19/23 02:17, kdevel wrote: Should this compile? dmd says Multiple points: - lockstep works only with foreach loops but it's not a range. - std.range.zip can be used instead but it does not provide 'ref' access to its elements. - However, since slices are already references to groups

Re: Best way to use C library

2023-05-19 Thread user456 via Digitalmars-d-learn
On Friday, 19 May 2023 at 18:31:45 UTC, Maximilian Naderer wrote: Hello guys, So what’s currently the best way to use a big C library? Let’s assume something like cglm assimp glfw ImportC doesn’t really work for such huge libraries, I’ll investigate further. Deimos is outdated or there are

Re: Best way to use C library

2023-05-19 Thread jmh530 via Digitalmars-d-learn
On Friday, 19 May 2023 at 18:31:45 UTC, Maximilian Naderer wrote: Hello guys, So what’s currently the best way to use a big C library? Let’s assume something like cglm assimp glfw ImportC doesn’t really work for such huge libraries, I’ll investigate further. Deimos is outdated or there are

Best way to use C library

2023-05-19 Thread Maximilian Naderer via Digitalmars-d-learn
Hello guys, So what’s currently the best way to use a big C library? Let’s assume something like cglm assimp glfw ImportC doesn’t really work for such huge libraries, I’ll investigate further. Deimos is outdated or there are no bindings. I know that there is a dub package for glfw which

Re: request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread anonymouse via Digitalmars-d-learn
On Friday, 19 May 2023 at 12:28:20 UTC, kdevel wrote: On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote: What am I doing wrong here? [...] curl.set(CurlOption.writedata, ); According to [1] this line must read ``` curl.set(CurlOption.writedata, cast (void *)

Re: request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread anonymouse via Digitalmars-d-learn
On Friday, 19 May 2023 at 12:28:20 UTC, kdevel wrote: On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote: What am I doing wrong here? [...] curl.set(CurlOption.writedata, ); According to [1] this line must read ``` curl.set(CurlOption.writedata, cast (void *)

Re: request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread Danny Arends via Digitalmars-d-learn
On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote: What am I doing wrong here? ```D import std.net.curl: Curl, CurlOption, CurlException; import std.file: exists; import std.stdio: File, writefln; import core.thread: Thread; void downloadFile(string url, string filename) { while

Re: request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread kdevel via Digitalmars-d-learn
On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote: What am I doing wrong here? [...] curl.set(CurlOption.writedata, ); According to [1] this line must read ``` curl.set(CurlOption.writedata, cast (void *) fp.getFP()); ``` [1]

request assistance resolving a std.net.curl segmentation fault

2023-05-19 Thread anonymouse via Digitalmars-d-learn
What am I doing wrong here? ```D import std.net.curl: Curl, CurlOption, CurlException; import std.file: exists; import std.stdio: File, writefln; import core.thread: Thread; void downloadFile(string url, string filename) { while (true) { try { File fp; if

request assistance resolving a std.net.curl sementation fault

2023-05-19 Thread anonymouse via Digitalmars-d-learn
What am I doing wrong here? ```D import std.net.curl: Curl, CurlOption, CurlException; import std.file: exists; import std.stdio: File, writefln; import core.thread: Thread; void downloadFile(string url, string filename) { while (true) { try { File fp; if

Re: Can dmd compile a favicon.ico to exe file ?

2023-05-19 Thread John Xu via Digitalmars-d-learn
On Thursday, 18 May 2023 at 15:39:05 UTC, Richard (Rikki) Andrew Cattermole wrote: On 19/05/2023 2:19 AM, John Xu wrote: On Monday, 15 May 2023 at 03:54:03 UTC, Richard (Rikki) Andrew Cattermole wrote: That is only for OMF target. You need rc that comes with Visual Studio C++ build tools.

Lockstep iteration in parallel: Error: cannot have parameter of type `void`

2023-05-19 Thread kdevel via Digitalmars-d-learn
``` import std.range; import std.parallelism; void vec_op (double [] outp, const double [] inp, double function (double) f) { foreach (ref a, b; parallel (lockstep (outp, inp))) a = f (b); } ``` Should this compile? dmd says ``` [...]/src/phobos/std/parallelism.d(4094): Error: