Skip to content
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

Doesn't build on freebsd #128

Open
BornTactical opened this issue May 4, 2023 · 1 comment
Open

Doesn't build on freebsd #128

BornTactical opened this issue May 4, 2023 · 1 comment

Comments

@BornTactical
Copy link

error: ld.lld: undefined symbol: hid_init
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(BSD_JoystickInit) in archive /usr/local/lib/libSDL2.a
error: ld.lld: undefined symbol: hid_end_parse
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(BSD_JoystickUpdate) in archive /usr/local/lib/libSDL2.a
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(CreateHwData) in archive /usr/local/lib/libSDL2.a
error: ld.lld: undefined symbol: hid_start_parse
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(BSD_JoystickUpdate) in archive /usr/local/lib/libSDL2.a
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(CreateHwData) in archive /usr/local/lib/libSDL2.a
error: ld.lld: undefined symbol: hid_get_data
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(BSD_JoystickUpdate) in archive /usr/local/lib/libSDL2.a
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(BSD_JoystickUpdate) in archive /usr/local/lib/libSDL2.a
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(BSD_JoystickUpdate) in archive /usr/local/lib/libSDL2.a
error: ld.lld: undefined symbol: hid_get_item
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(BSD_JoystickUpdate) in archive /usr/local/lib/libSDL2.a
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(CreateHwData) in archive /usr/local/lib/libSDL2.a
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(CreateHwData) in archive /usr/local/lib/libSDL2.a
error: ld.lld: undefined symbol: hid_dispose_report_desc
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(BSD_JoystickClose) in archive /usr/local/lib/libSDL2.a
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(MaybeAddDevice) in archive /usr/local/lib/libSDL2.a
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(MaybeAddDevice) in archive /usr/local/lib/libSDL2.a
    note: referenced 1 more times
error: ld.lld: undefined symbol: inotify_init1
    note: referenced by SDL_sysjoystick.c
    note:               SDL_sysjoystick.o:(LINUX_JoystickInit) in archive /usr/local/lib/libSDL2.a
error: ld.lld: undefined symbol: inotify_add_watch
    note: referenced by SDL_sysjoystick.c
    note:               SDL_sysjoystick.o:(LINUX_JoystickInit) in archive /usr/local/lib/libSDL2.a
error: ld.lld: undefined symbol: hid_get_report_desc
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(CreateHwData) in archive /usr/local/lib/libSDL2.a
error: ld.lld: undefined symbol: hid_get_report_id
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(CreateHwData) in archive /usr/local/lib/libSDL2.a
error: ld.lld: undefined symbol: hid_report_size
    note: referenced by SDL_bsdjoystick.c
    note:               SDL_bsdjoystick.o:(CreateHwData) in archive /usr/local/lib/libSDL2.a

I addressed this by adding a new section to build.zig:

else if (target.os.tag == .freebsd) {
    exe.linkSystemLibrary("sdl2");
    exe.linkSystemLibrary("inotify");
    exe.linkSystemLibrary("usbhid");
}

I'm not sure what else it will need but that works for the example program at least.

@jbeich
Copy link

jbeich commented Jun 14, 2023

Duplicate of ziglang/zig#14111. Workaround:

$ export PKG_CONFIG_SYSTEM_LIBRARY_PATH="/usr/local/lib"

or (csh-style)

% setenv PKG_CONFIG_SYSTEM_LIBRARY_PATH "/usr/local/lib"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants