#Error when trying to @cImport libuv (uv.h)

1 messages · Page 1 of 1 (latest)

wanton gust
#

I am using zig master 0.11.0-dev.1438+5d46addd2

I tried importing libuv like this:

const c = @cImport({
  @cInclude("uv.h");
});

but got the same old error as in this old closed issue
https://github.com/ziglang/zig/issues/12471#issuecomment-1219839044

error: dependency loop detected
pub const uv_close_cb = ?*const fn ([*c]uv_handle_t) callconv(.C) void;
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I don't really understand why this is happening, as the github issue is marked as resolved but I am still getting the same error with the newest version.

GitHub

Zig Version 0.10.0-dev.3587+9d85335de Steps to Reproduce I'm trying to extract a minimal repo for you since the repo I have isn't open. But, its quite simple: pub usingnamespace @cI...

arctic sedge
#

It does not look like the same issue though

#

The original issue was for this error:

.../zig-cache/o/e37ac1d01edd5da25d95ea916308d281/cimport.zig:5615:30: error: use of undeclared identifier 'sched_priority'                                               pub const __sched_priority = sched_priority;                                                                      ^~~~~~~~~~~~~~    
#

Which was due to how zig handled self defined macros

#

Ok once the original issue was solved the reporter reported the issue you have in a comment saying that they were not going to open another issue because it was not happening in stage1. So apparently it was never solved.

wanton gust
wanton gust
arctic sedge
#

There is a couple of other in the issue tracker

#

One of the comment point at a workaround.

#

But you need to change the zig compiler itself.

wanton gust
#

Yeah okay don't really wanna do that