Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 388 Bytes

README.md

File metadata and controls

17 lines (13 loc) · 388 Bytes

hello-zig-cpp

A demo how to call c++ from Zig

based on https://github.com/anagram3k/zig-with-cpp

  1. using a c++ lib, a binding.cpp and binding.h should be appended to build the lib;
  2. binding.h should be installed
  3. use
const c = @cImport({
    @cInclude("xlib/binding.h"); // the binding.h installed path
});

in zig, and call binding things with c.*

zig build run