#Android <spawn.h> problem
1 messages · Page 1 of 1 (latest)
these functions are guarded behind android SDK verison 28 or higher. are you setting the correct sdk version?
https://android.googlesource.com/platform/bionic/+/master/libc/include/spawn.h#59
also, is spawn.h definitely being #included?
I mean I run this: steam-run zig build -Dtarget=x86_64-linux-android.35
my build.zig in the SDL-zig repo should handle that
https://github.com/silbinarywolf/zig-android-sdk I use this btw
that doesn't appear to define any android related C macros, so you'll have to do that yourself
you need to specify __ANDROID_MIN_SDK_VERSION__
same error with:
var exe: *std.Build.Step.Compile = if (t.result.abi.isAndroid()) b.addLibrary(.{
.name = exe_name,
.root_module = app_module,
.linkage = .dynamic,
}) else b.addExecutable(.{
.name = exe_name,
.root_module = app_module,
});
const sdl = b.dependency("sdl", .{
.target = t,
.optimize = optimize,
});
const sdl_lib = sdl.artifact("SDL3");
sdl_lib.addSystemIncludePath(.{ .cwd_relative = "/home/leeb/Android/Sdk/ndk/29.0.13599879/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/"});
exe.linkLibC();
exe.linkLibrary(sdl_lib);
exe.root_module.addCMacro("__ANDROID_MIN_SDK_VERSION__", "28");
exe.addSystemIncludePath(.{ .cwd_relative = "/home/leeb/Android/Sdk/ndk/29.0.13599879/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/"});
I hope we can talk about this later since I need to go right now
I'm back
can you put this in a code block so it's more readable? ``` on either side
sure
ty :)
you need to define the macro on sdl_lib too
Now there are even more errors and the errors from before persist lol
<command line>:8:9: error: '__ANDROID_MIN_SDK_VERSION__' macro redefined```
and also this?
My full implementation:
hmm okay interesting
I think zig-android-sdk already defines the api level
ah, yes that would make sense
hmm why are you setting include paths yourself if you're using an existing android sdk package?
shouldn't it set those for you?
also you don't seem to ever make the android sdk package aware of the SDL library, you probably need to do that somehow
idk exactly how because i'm not familiar with the package
trueeee
I just used this as a reference for my implementation: https://github.com/stark26583/SDL
But I just skimmed over it, so I can't guarantee that I did everything they did there
Imma open up an issue in the zig-android-sdk for that
Got a new error now: