Zig NEWS

Discussion on: Extend a C/C++ Project with Zig

Collapse
 
spirobel profile image
spirobel

is it possible to call cpp directly from zig or do I need to make a C wrapper for cpp code and then call that from zig?

Thread Thread
 
kristoff profile image
Loris Cro

you have to make a C wrapper

Thread Thread
 
spirobel profile image
spirobel

how do you go about calling cpp from zig? you need to write a C wrapper, correct? Is there a tutorial on how to write these kinds of wrappers?
you probably also need to handle exceptions and turn them into normal value like errors, right?
I came accross this one: teddy.ch/c++_library_in_c it is not specific to zig. I guess especially exceptions need to be handled carefully, because zig does not support that, right?