William R. Elliot
2024-Nov-02 01:18 UTC
[Nut-upsdev] Driver with calls to USB functions not linking
Hello again all. I am trying to use USB functions (non-HID) and I get a linker error for functions that are in the included usb-common.h file. Specifically, at the start, these functions: - warn_if_bad_usb_port_filename - nutusb_open - is_usb_device_supported Clearly the headers are there or I don't think the driver would compile. Can someone point me in the right direction please? Thank you, Bill Not sure if these USB related lines from the configuration run are relevant or not: checking for libregex version via pkg-config... none found checking for regex.h... yes checking whether regexec is declared... yes checking whether regcomp is declared... yes checking for libusb-1.0 version via pkg-config... 1.0.27 found checking for libusb(-0.1) version via pkg-config... 0.1.12 found checking for libusb-config... /usr/bin/libusb-config checking via /usr/bin/libusb-config... 0.1.12 found checking for libusb preferred version... 1.0.27 (libusb-1.0) checking for libusb cflags... -I/usr/include/libusb-1.0 checking for libusb ldflags... -lusb-1.0 checking for libusb.h... yes checking for libusb_init... yes checking for libusb_strerror... yes checking for libusb_kernel_driver_active... yes checking for libusb_set_auto_detach_kernel_driver... yes checking for libusb_detach_kernel_driver... yes checking for libusb_detach_kernel_driver_np... no checking for usb_detach_kernel_driver_np... no checking for libusb_get_port_number... yes checking whether to build USB drivers... yes (libusb-1.0) checking whether to install hotplug rules... no checking whether to generate scripts/udev/nut-usbups.rules... yes * build USB drivers: yes (libusb-1.0) -- This email has been checked for viruses by AVG antivirus software. www.avg.com
Jim Klimov
2024-Nov-02 16:45 UTC
[Nut-upsdev] Driver with calls to USB functions not linking
Do your drivers/Makefile.am rules for the resulting new program specify dependencies to use similar to other USB-capable drivers? e.g. ```` blazer_usb_SOURCES = blazer.c blazer_usb.c $(LIBUSB_IMPL) usb-common.c blazer_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm ```` Jim On Sat, Nov 2, 2024 at 2:30?AM William R. Elliot <bill at wreassoc.com> wrote:> Hello again all. > > I am trying to use USB functions (non-HID) and I get a linker error > for functions that are in the included usb-common.h file. > > Specifically, at the start, these functions: > - warn_if_bad_usb_port_filename > - nutusb_open > - is_usb_device_supported > > Clearly the headers are there or I don't think the driver would > compile. Can someone point me in the right direction please? > > Thank you, > > Bill > > Not sure if these USB related lines from the configuration run are > relevant or not: > > checking for libregex version via pkg-config... none found > checking for regex.h... yes > checking whether regexec is declared... yes > checking whether regcomp is declared... yes > checking for libusb-1.0 version via pkg-config... 1.0.27 found > checking for libusb(-0.1) version via pkg-config... 0.1.12 found > checking for libusb-config... /usr/bin/libusb-config > checking via /usr/bin/libusb-config... 0.1.12 found > checking for libusb preferred version... 1.0.27 (libusb-1.0) > checking for libusb cflags... -I/usr/include/libusb-1.0 > checking for libusb ldflags... -lusb-1.0 > checking for libusb.h... yes > checking for libusb_init... yes > checking for libusb_strerror... yes > checking for libusb_kernel_driver_active... yes > checking for libusb_set_auto_detach_kernel_driver... yes > checking for libusb_detach_kernel_driver... yes > checking for libusb_detach_kernel_driver_np... no > checking for usb_detach_kernel_driver_np... no > checking for libusb_get_port_number... yes > checking whether to build USB drivers... yes (libusb-1.0) > checking whether to install hotplug rules... no > checking whether to generate scripts/udev/nut-usbups.rules... yes > * build USB drivers: yes (libusb-1.0) > > > -- > This email has been checked for viruses by AVG antivirus software. > www.avg.com > > _______________________________________________ > Nut-upsdev mailing list > Nut-upsdev at alioth-lists.debian.net > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://alioth-lists.debian.net/pipermail/nut-upsdev/attachments/20241102/289f1569/attachment.htm>