This program works on Linux and fetches the web page, but on Mac it fails. Doing some small sleuthing it appears to not be able to parse the URL, but I do not understand how setting the URL is failing.
Sorry to be a bit of a pill... would it be possible to minimize this, so it doesn't define syntax or include other extra stuff? My first guess is that it has to do with the string type that gets passed, but my 5-minute timer just went off
The curl library should also be sending data to the process stdout and stderr, so there may be some side-effects that you cannot see if you run it in DrRacket. That does look like it is working on your system. On my Mac I get 0 0 0 3 in DrRacket and from the command line I get
So it seems it fetches the page fine.
This is on macOS Ventura.
I have Apples Developer CommandLineTools installed (under additional downloads).
Not sure whether it makes a difference.
The third argument of curl_easy_setopt is variadic (those ... in C), so this needs to be reflected in the type signature in order for the calling convention to work.
This difference is sort of more evident when I tried to translate this into C. If you change the type of the third argument of dyn_curl_easy_setopt_url to char*, the C program ends up crashing.