-
Notifications
You must be signed in to change notification settings - Fork 59
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
Can't create a new database #107
Comments
You need to set the target and mode on the sqlite library too:
I'm not sure why it fails when not adding this. And yeah it looks like the readme instructions are incomplete. |
Added: const std = @import("std");
pub fn build(b: *std.build.Builder) void {
var target = b.standardTargetOptions(.{});
const mode = b.standardReleaseOptions();
const sqlite = b.addStaticLibrary("sqlite", null);
sqlite.addCSourceFile("zig-sqlite/c/sqlite3.c", &[_][]const u8{"-std=c99"});
sqlite.linkLibC();
target.setGnuLibCVersion(2, 28, 0);
sqlite.setTarget(target);
sqlite.setBuildMode(mode);
const test_all = b.step("test", "Run tests");
{
const test_cases = b.addTest("test.zig");
test_cases.use_stage1 = true;
test_cases.linkLibrary(sqlite);
test_cases.addPackagePath("sqlite", "zig-sqlite/sqlite.zig");
test_cases.addIncludeDir("zig-sqlite/c");
test_cases.setTarget(target);
test_cases.setBuildMode(mode);
test_all.dependOn(&test_cases.step);
}
} same error. |
Right, I accidentally executed the test with the file already existing so it passed. Building with musl instead works fine ( |
I did a little digging, the error For
so I'm not sure what exactly is wrong here, especially since building with musl works fine. |
Pretty sure it's this issue actually. |
Wow, that is really great digging! Although compiling with musl doesn't work likely because of this bug, stacktrace below. I guess we will have to wait.
|
This is weird, this linking error happens when building with glibc and not specifying the glibc version with
In your reproducer code you have to remove this line, then building with |
Hi. Is this issue still relevant @greenfork ? |
I couldn't quickly restore the example, I suppose we can close this, I will re-open if I get this behavior again. |
I have followed the instructions on the readme page to install the package. It works when the database file already exists but fails when there's no file. Here I have come up with a minimal example, copy these to files in a directory:
Then in this directory do:
produces errors:
The text was updated successfully, but these errors were encountered: