I'm using libcurl for HTTP POST requests, importing with:
const cURL = @cImport({
@cInclude("curl/curl.h");
});
With this in build.zig:
exe.linkLibC();
exe.linkSystemLibrary("curl");
Compilation works great on my native platform (macOS), but fails when targeting other platforms such as Linux:
> zig build -Drelease-safe=true -Dtarget=x86_64-linux
/Users/nick/Play/zig/myproject/src/http.zig:3:14: error: C import failed
const cURL = @cImport({
What do I need to do to be able to cross-compile libcurl for multiple platforms on macOS?
Do I need to bundle libcurl headers with my application? If so, which files do I need from https://github.com/curl/curl ?