#Trying to get zig-curl working on Windows, running into null ptr issues

1 messages · Page 1 of 1 (latest)

modern rune
#

Hey, i'm trying to get zig-curl's basic example working on windows and I'm running into the following crash

zig build run
--------------------GET demo--------------------
--------------------GET with allocator--------------------
thread 15420 panic: member access within null pointer of type 'struct thread_sync_data'
zig\p\N-V-__8AAHipPQF9UuLPiaV1CtJzZIxvTN61tMGdFx8LGjIV\lib\asyn-thread.c:309:0: 0x7ff77f3decf0 in query_complete (curl.lib)
  struct thread_sync_data *tsd =

???:?:?: 0x7ffdb2866889 in ??? (WS2_32.dll)
???:?:?: 0x7ffdb2868ad2 in ??? (WS2_32.dll)
???:?:?: 0x7ffdb2868712 in ??? (WS2_32.dll)
???:?:?: 0x7ffdb2868558 in ??? (WS2_32.dll)
???:?:?: 0x7ffdb2867e1e in ??? (WS2_32.dll)
???:?:?: 0x7ffdb286a78b in ??? (WS2_32.dll)
???:?:?: 0x7ffdb286a6e4 in ??? (WS2_32.dll)
???:?:?: 0x7ffdb2869f48 in ??? (WS2_32.dll)
???:?:?: 0x7ffdb3841d08 in ??? (ntdll.dll)
???:?:?: 0x7ffdb381d799 in ??? (ntdll.dll)
???:?:?: 0x7ffdb1fc7373 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffdb381cc90 in ??? (ntdll.dll)

any ideas as to what could be causing this?

GitHub

Zig bindings for libcurl. Contribute to jiacai2050/zig-curl development by creating an account on GitHub.

rancid rock
#

Are you on windows windows ? or windows WSL ( Windows Subsystem Linux ) ?

modern rune
#

windows windows

rancid rock
# modern rune windows windows

I think it's your problem

my personal advice for right now and for the future : switch to Linux.

my immediately actionable advice : try WSL

#

but ultimately, just switch to Linux. It will save you so much time

modern rune
rancid rock
cosmic lava
#

zig-curl only has ci for Linux and macOS so I’m not certain that it would work on windows

modern rune
cosmic lava
#

oh you need to cImport it

#

since there aren’t bindings, just headers

#

Usage would just be the same usage as in C

modern rune
#

Ohh I see. So I would still need curl/curl.h?

cosmic lava
#

Yeah but the package links it for you

#

not links sorry

#

Includes it

#

Once you linkLibrary the curl headers become available for cImporting

modern rune
#

Ohhh I seeeee