zig-015-shared-bug/main.zig

21 lines
547 B
Zig

const std = @import("std");
pub fn main() !void {
// Load the shared library
var lib = try std.DynLib.open("./zig-out/lib/libshared.so");
defer lib.close();
std.debug.print("Loaded that shizz\n", .{});
const test_debug_print = lib.lookup(*const fn () callconv(.c) void, "test_debug_print") orelse {
return error.CantFindIt;
};
std.debug.print("test_debug_print found... calling...\n", .{});
// Call the function from the shared library
test_debug_print();
std.debug.print("called \n", .{});
}