I'm trying to compile Soarer's Converter on Fedora 29 and running into typedef problems. This is a somewhat old utility for programming USB converters for old terminal and XT keyboards based on an Arduino Teensy. More info here on that here:
https://geekhack.org/index.php?topic=17458.0
I have libusb-devel installed and /usr/include/usb.h and /usr/include/stdint.h are both present. Running the included makefile for the Linux build just dumps unknown type name errors for u_int8_t and u_int16_t:
/usr/include/usb.h:81:2: error: unknown type name ‘u_int8_t’ u_int8_t bLength; ^~~~~~~~ /usr/include/usb.h:82:2: error: unknown type name ‘u_int8_t’ u_int8_t bDescriptorType; ^~~~~~~~ /usr/include/usb.h:87:2: error: unknown type name ‘u_int8_t’ u_int8_t bLength; ^~~~~~~~
Tested compiling the code on Debian and Ubuntu with the equivalent libraries installed and it produces the binaries just fine, so I must be missing something on the Fedora procedure. It's almost like it's missing the stdint.h header but I've verified it's present. The binaries I compiled on the Debian install even work just fine on F29 which leads me to believe I'm just missing a -devel package needed to compile it. Thought maybe it needed the avr-libc package and it's headers but that didn't seem to help.
Unfortunately the original person who wrote this code has long since vanished but Teensy stuff is pretty popular so I thought it'd be worth a shot to ask here! I haven't messed with any other Teensy code myself.
Thanks!
Leander
Leander Hutton writes:
I have libusb-devel installed and /usr/include/usb.h and /usr/include/stdint.h are both present. Running the included makefile for the Linux build just dumps unknown type name errors for u_int8_t and u_int16_t:
/usr/include/usb.h:81:2: error: unknown type name ‘u_int8_t’ u_int8_t bLength; ^~~~~~~~ /usr/include/usb.h:82:2: error: unknown type name ‘u_int8_t’ u_int8_t bDescriptorType; ^~~~~~~~ /usr/include/usb.h:87:2: error: unknown type name ‘u_int8_t’ u_int8_t bLength; ^~~~~~~~
Tested compiling the code on Debian and Ubuntu with the equivalent libraries installed and it produces the binaries just fine, so I must be missing something on the Fedora procedure. It's almost like it's missing
It's not that something's missing, but that something's is now a different version.
Unfortunately the original person who wrote this code has long since vanished but Teensy stuff is pretty popular so I thought it'd be worth a shot to ask here! I haven't messed with any other Teensy code myself.
A brief grep finds these typedefs defined in <sys/types.h>:
#include <sys/types.h>
typedef u_int8_t foo;
This compiles just fine.
So, I surmise that the code in question was using something that itself includes sys/types.h, but whatever that is, the version on Fedora doesn't itself include it.
You'll just need to figure out which modules need this, and manually shove that include in there, yourself. That'll probably fix it.
On 3/29/19 11:29 PM, Sam Varshavchik wrote:
A brief grep finds these typedefs defined in <sys/types.h>:
#include <sys/types.h>
typedef u_int8_t foo;
This compiles just fine.
So, I surmise that the code in question was using something that itself includes sys/types.h, but whatever that is, the version on Fedora doesn't itself include it.
You'll just need to figure out which modules need this, and manually shove that include in there, yourself. That'll probably fix it.
Did some comparing between the Debian version of usb.h and Fedora. The usb.h on Debian included sys/param.h and the Fedora version omits this.
sys/param.h then includes sys/types.h, so that was indeed the underlying cause. Shoving that include in place on the RawHID common include Soarer's Converter bundles did allow it to be compiled on F29.
I guess I need to figure out how to keep up with this since I don't think anyone's maintaining the Linux version of this utility anymore.
Many thanks! Now off to use my very old and very loud keyboard!
Leander
Leander Hutton writes:
Did some comparing between the Debian version of usb.h and Fedora. The usb.h on Debian included sys/param.h and the Fedora version omits this.
/usr/include/usb.h is installed by the libusb 0.1.5, a comparatively old version
sys/param.h then includes sys/types.h, so that was indeed the underlying cause. Shoving that include in place on the RawHID common include Soarer's Converter bundles did allow it to be compiled on F29.
On Fedora, libusb 1.0 is parallel-installed as libusbx, with libusbx- devel-1.0.22 installing /usr/include/libusb-1.0/libusb.h which looks like the same one that you see on Debian as /usr/include/usb.h