Last active
January 28, 2020 16:53
-
-
Save naltun/a1a305584d5f890d2f3914eece275e25 to your computer and use it in GitHub Desktop.
My basic main.zig and Makefile
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
// main.zig | |
const std = @import("std"); | |
const warn = std.debug.warn; | |
const libcurl = @cImport(@cInclude("/usr/include/curl/curl.h")); | |
pub fn main() void { | |
const curl = libcurl.curl_easy_init(); | |
warn("Hello, World!\n"); | |
} | |
// Makefile | |
TARGET=test | |
all: | |
zig build-exe src/main.zig \ | |
--name test \ | |
--output-dir release/ \ | |
--library c \ | |
--library curl | |
clean: | |
rm release/{${TARGET},${TARGET}.o} | |
// Output | |
$ make | |
zig build-exe src/main.zig \ | |
--name test \ | |
--output-dir release/ \ | |
--library c \ | |
--library curl | |
lld: error: unable to find library -lcurl | |
make: *** [Makefile:4: all] Error 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment