Last active
January 28, 2020 20:16
-
-
Save naltun/cc7924a6f8f421a94cd7713b06bff543 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The code | |
const http = @import("http.zig"); | |
const std = @import("std"); | |
const warn = std.debug.warn; | |
const libcurl = @cImport(@cInclude("/usr/include/curl/curl.h")); | |
pub fn main() void { | |
var curl: *libcurl.CURL = libcurl.curl_easy_init(); | |
var res: libcurl.CURLcode = undefined; | |
var url = "https://example.com"; | |
libcurl.curl_easy_setopt(curl, libcurl.CURLOPT_URL, url); | |
res = libcurl.curl_easy_perform(curl); | |
libcurl.curl_easy_cleanup(curl); | |
warn("Success!\n"); | |
} | |
// The output from `make' | |
/vagrant/test/src/main.zig:20:43: error: expected type '.cimport:13:17.CURLoption', found 'comptime_int' | |
libcurl.curl_easy_setopt(curl, libcurl.CURLOPT_URL, url); | |
^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment