Created
September 5, 2019 16:30
-
-
Save Lucus16/bb1e9d226f7b388a575e621cb2aa0a56 to your computer and use it in GitHub Desktop.
This file contains 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
$ nix-shell --pure -p zig glibc --run 'zig run main.zig' | |
/home/lars/tmp/foo/main.zig:2:11: error: C import failed | |
const c = @cImport(@cInclude("termios")); | |
^ | |
/home/lars/tmp/foo/main.zig:2:11: note: libc headers not available; compilation does not link against libc | |
const c = @cImport(@cInclude("termios")); | |
^ | |
/home/lars/.local/share/zig/stage1/o/XzhNJvQsO9t306oyg3q9n1dSgg77Kb5mp_EUe-JWYMXWtCcqWaACdv5tCO4OXJKV/cimport.h:1:10: note: 'termios' file not found | |
#include <termios> | |
^ | |
/home/lars/tmp/foo/main.zig:6:23: error: container 'std.os' has no member called 'STDIN_FILENO' | |
c.tcgetattr(std.os.STDIN_FILENO, &term); | |
^ |
This file contains 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
const std = @import("std"); | |
const c = @cImport(@cInclude("termios")); | |
pub fn main() void { | |
var term: c.struct_termios = {}; | |
c.tcgetattr(std.os.STDIN_FILENO, &term); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment