-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cimport, error: dependency loop detected #18247
Comments
I build success by modify the declare sequeue and works fine. At the beginning, I suspected that it's a problem with translate-c. But i compare the cimport.zig files, it's same! Follow is the modify patch:
|
Hit this while trying to use miniaudio. Found a stripped down repro which might be helpful test.h struct A;
typedef void (*function_callback)(struct A*);
struct A {
function_callback callback;
};
struct B {
function_callback callback;
}; . const c = @cImport({
@cInclude("test.h");
});
pub fn main() void {
const v: c.B = undefined;
_ = v;
} Run with
Observed on zig 0.12.0 and nightly zig-linux-x86_64-0.13.0-dev.75+5c9eb4081 |
Implement audio playback, hopefully motivation is self explanatory The audio landscape is vast in linux, we have alsa, pulse, jack, pipewire and alsa, pulse, jack interfaces into pipewire, alsa interfaces into pulse, etc. Instead of trying to deal with this ourselves, pull in an audio lib to deal with it for us Just skimming online, miniaudio fits well. PortAudio and libsoundio also seem to both be good candidates. No strong reasoning went into this choice, the single header impl of miniaudio felt easy to work with. We were tricked though, with the default miniaudio impl we hit a zig compiler bug that triggers circular dependencies. Something about using a struct pointer in a function pointer stored by the struct, see ziglang/zig#18247 (comment) Patch miniaudio to just use void pointers instead, this doesn't seem to have any negative effects Add an audio player abstraction that just injects a sin wave for now, add test binary to try it Potentially related issues... ziglang/zig#12325 ziglang/zig#16419
Implement audio playback, hopefully motivation is self explanatory The audio landscape is vast in linux, we have alsa, pulse, jack, pipewire and alsa, pulse, jack interfaces into pipewire, alsa interfaces into pulse, etc. Instead of trying to deal with this ourselves, pull in an audio lib to deal with it for us Just skimming online, miniaudio fits well. PortAudio and libsoundio also seem to both be good candidates. No strong reasoning went into this choice, the single header impl of miniaudio felt easy to work with. We were tricked though, with the default miniaudio impl we hit a zig compiler bug that triggers circular dependencies. Something about using a struct pointer in a function pointer stored by the struct, see ziglang/zig#18247 (comment) Patch miniaudio to just use void pointers instead, this doesn't seem to have any negative effects Add an audio player abstraction that just injects a sin wave for now, add test binary to try it Potentially related issues... ziglang/zig#12325 ziglang/zig#16419 ziglang/zig#19392
Implement audio playback, hopefully motivation is self explanatory The audio landscape is vast in linux, we have alsa, pulse, jack, pipewire and alsa, pulse, jack interfaces into pipewire, alsa interfaces into pulse, etc. Instead of trying to deal with this ourselves, pull in an audio lib to deal with it for us Just skimming online, miniaudio fits well. PortAudio and libsoundio also seem to both be good candidates. No strong reasoning went into this choice, the single header impl of miniaudio felt easy to work with. We were tricked though, with the default miniaudio impl we hit a zig compiler bug that triggers circular dependencies. Something about using a struct pointer in a function pointer stored by the struct, see ziglang/zig#18247 (comment) Patch miniaudio to just use void pointers instead, this doesn't seem to have any negative effects Extract audio frames from ffmepg, and feed them into our audio subsystem. Not a ton to say here, everything is just using the APIs provided by miniaudio and ffmpeg Replace test video with a 20s segment of big buck bunny Potentially related issues... ziglang/zig#12325 ziglang/zig#16419 ziglang/zig#19392
Zig Version
0.12.0-dev.1808+69195d0cd
Steps to Reproduce and Observed Behavior
I want to call pjsip(open source: https://github.com/pjsip/pjproject) library in zig.
Here my simple sample : https://github.com/jimying/testpj.zig
steps to build sample (tested in linux x86_64):
Expected Behavior
build and run ok
The text was updated successfully, but these errors were encountered: