debrouxl / tilibs

TILP (formerly GtkTiLink) can transfer data between Texas Instruments graphing calculators and a computer. It works with all link cables (parallel, serial, Black/Gray/Silver/Direct Link) and it supports the TI-Z80 series (73..86), the TI-eZ80 series (83PCE, 84+CE), the TI-68k series (89, 92, 92+, V200, 89T) and the Nspire series (Nspire Clickpad / Touchpad / CX, both CAS and non-CAS)
http://lpg.ticalc.org/prj_tilp
63 stars 23 forks source link

libticables: fix compiler error, struct usb_device missing 'struct' keyword #79

Closed spongus711 closed 10 months ago

spongus711 commented 1 year ago

when building for linux, the compiler gives the following errors which have been fixed in this commit: linux/link_usb.cc:402:31: error: expected primary-expression before ‘)’ token 402 | *udh = usb_open((usb_device *)(tigl_devices[id].dev)); linux/link_usb.cc:507:22: error: expected primary-expression before ‘)’ token 507 | uDev = (usb_device *)(tigl_devices[h->address].dev);

debrouxl commented 1 year ago

Hello, Under which flavor of Linux and libc can you see this build error ? Also, is it when building against libusb 0.1.x, which is scarce on modern distros, rather than the libusb 0.1.x compatibility layer for libusb 1.0.x ? libticalcs' libusb 0.1.x backend cannot work against the latter, and by now, most users should be using the libusb 1.0.x backend, which - unless there's a bug - ought to be enabled by default :)

spongus711 commented 1 year ago

I'm using Linux Mint 20.3 with libc 2.31, and libusb 1.0.0.

debrouxl commented 1 year ago

The libusb 1.0.x backend is in link_usb1.c, so you're compiling against the libusb 0.1.x API, whether you're using the compat layer or not. With libusb-1.0-0-dev installed, try passing --enable-libusb10 to libticables' configure explicitly. That's what both the standard libti*+gfm+tilp maintainer and the user build scripts ( https://github.com/debrouxl/tilp_and_gfm/blob/master/tilp/trunk/build/scripts/install_tilp.sh ) are doing, for historical reasons.

adriweb commented 1 year ago

(that said, it does look like the fix is correct? At least the other usages of this struct have struct)

spongus711 commented 1 year ago

Building against libusb 0.1.12 throws the same error as before, so I think struct does belong there. And --enable-libusb10 works with libusb 1.0.x, thanks.