Upgrade pi 1.52 to 1.6

I have a problem compiling. When I run these commands I get this error message:

cd Downloads
chmod +x fullbuild-wfview.sh
./fullbuild-wfview.sh

The build process may take a few minutes.
Press enter to start.
Starting build process.
Info: creating stash file /home/pi/Downloads/wfview–20230207–22-05-19/build/.qmake.stash
Project ERROR: Unknown module(s) in QT: gamepad
Error in qmake step.

many thanks for your help

73 Ralph

Hi Ralf

Please download the latest build script as the pre-requisites have changed.

Thanks

Phil

Hi Phil,
Thanks! the compilation starts and these error messages have come:

In file included from …/wfview/usbcontroller.cpp:3:
…/wfview/usbcontroller.cpp: In member function ‘void usbController::init(int)’:
…/wfview/usbcontroller.h:29:46: error: ‘HID_API_VERSION_MAJOR’ was not declared in this scope
#define HID_API_VERSION HID_API_MAKE_VERSION(HID_API_VERSION_MAJOR, HID_API_VERSION_MINOR, HID_API_VERSION_PATCH)
^~~~~~~~~~~~~~~~~~~~~
…/wfview/usbcontroller.h:26:44: note: in definition of macro ‘HID_API_MAKE_VERSION’
#define HID_API_MAKE_VERSION(mj, mn, p) (((mj) << 24) | ((mn) << 8) | (p))
^~
…/wfview/usbcontroller.cpp:46:9: note: in expansion of macro ‘HID_API_VERSION’
if (HID_API_VERSION == HID_API_MAKE_VERSION(hid_version()->major, hid_version()->minor, hid_version()->patch)) {
^~~~~~~~~~~~~~~
…/wfview/usbcontroller.h:29:46: note: suggested alternative: ‘HID_API_VERSION’
#define HID_API_VERSION HID_API_MAKE_VERSION(HID_API_VERSION_MAJOR, HID_API_VERSION_MINOR, HID_API_VERSION_PATCH)
^~~~~~~~~~~~~~~~~~~~~
…/wfview/usbcontroller.h:26:44: note: in definition of macro ‘HID_API_MAKE_VERSION’
#define HID_API_MAKE_VERSION(mj, mn, p) (((mj) << 24) | ((mn) << 8) | (p))
^~
…/wfview/usbcontroller.cpp:46:9: note: in expansion of macro ‘HID_API_VERSION’
if (HID_API_VERSION == HID_API_MAKE_VERSION(hid_version()->major, hid_version()->minor, hid_version()->patch)) {
^~~~~~~~~~~~~~~
…/wfview/usbcontroller.h:29:69: error: ‘HID_API_VERSION_MINOR’ was not declared in this scope
#define HID_API_VERSION HID_API_MAKE_VERSION(HID_API_VERSION_MAJOR, HID_API_VERSION_MINOR, HID_API_VERSION_PATCH)
^~~~~~~~~~~~~~~~~~~~~
…/wfview/usbcontroller.h:26:59: note: in definition of macro ‘HID_API_MAKE_VERSION’
#define HID_API_MAKE_VERSION(mj, mn, p) (((mj) << 24) | ((mn) << 8) | (p))
^~
…/wfview/usbcontroller.cpp:46:9: note: in expansion of macro ‘HID_API_VERSION’
if (HID_API_VERSION == HID_API_MAKE_VERSION(hid_version()->major, hid_version()->minor, hid_version()->patch)) {
^~~~~~~~~~~~~~~
…/wfview/usbcontroller.h:29:69: note: suggested alternative: ‘HID_API_VERSION’
#define HID_API_VERSION HID_API_MAKE_VERSION(HID_API_VERSION_MAJOR, HID_API_VERSION_MINOR, HID_API_VERSION_PATCH)
^~~~~~~~~~~~~~~~~~~~~
…/wfview/usbcontroller.h:26:59: note: in definition of macro ‘HID_API_MAKE_VERSION’
#define HID_API_MAKE_VERSION(mj, mn, p) (((mj) << 24) | ((mn) << 8) | (p))
^~
…/wfview/usbcontroller.cpp:46:9: note: in expansion of macro ‘HID_API_VERSION’
if (HID_API_VERSION == HID_API_MAKE_VERSION(hid_version()->major, hid_version()->minor, hid_version()->patch)) {
^~~~~~~~~~~~~~~
…/wfview/usbcontroller.h:29:92: error: ‘HID_API_VERSION_PATCH’ was not declared in this scope
HID_API_MAKE_VERSION(HID_API_VERSION_MAJOR, HID_API_VERSION_MINOR, HID_API_VERSION_PATCH)
^~~~~~~~~~~~~~~~~~~~~

…/wfview/usbcontroller.h:26:72: note: in definition of macro ‘HID_API_MAKE_VERSION’
#define HID_API_MAKE_VERSION(mj, mn, p) (((mj) << 24) | ((mn) << 8) | (p))
^
…/wfview/usbcontroller.cpp:46:9: note: in expansion of macro ‘HID_API_VERSION’
if (HID_API_VERSION == HID_API_MAKE_VERSION(hid_version()->major, hid_version()->minor, hid_version()->patch)) {
^~~~~~~~~~~~~~~
…/wfview/usbcontroller.h:29:92: note: suggested alternative: ‘HID_API_VERSION’
HID_API_MAKE_VERSION(HID_API_VERSION_MAJOR, HID_API_VERSION_MINOR, HID_API_VERSION_PATCH)
^~~~~~~~~~~~~~~~~~~~~

…/wfview/usbcontroller.h:26:72: note: in definition of macro ‘HID_API_MAKE_VERSION’
#define HID_API_MAKE_VERSION(mj, mn, p) (((mj) << 24) | ((mn) << 8) | (p))
^
…/wfview/usbcontroller.cpp:46:9: note: in expansion of macro ‘HID_API_VERSION’
if (HID_API_VERSION == HID_API_MAKE_VERSION(hid_version()->major, hid_version()->minor, hid_version()->patch)) {
^~~~~~~~~~~~~~~
…/wfview/usbcontroller.cpp:46:49: error: ‘hid_version’ was not declared in this scope
if (HID_API_VERSION == HID_API_MAKE_VERSION(hid_version()->major, hid_version()->minor, hid_version()->patch)) {
^~~~~~~~~~~
…/wfview/usbcontroller.h:26:44: note: in definition of macro ‘HID_API_MAKE_VERSION’
#define HID_API_MAKE_VERSION(mj, mn, p) (((mj) << 24) | ((mn) << 8) | (p))
^~
…/wfview/usbcontroller.cpp:46:49: note: suggested alternative: ‘hid_error’
if (HID_API_VERSION == HID_API_MAKE_VERSION(hid_version()->major, hid_version()->minor, hid_version()->patch)) {
^~~~~~~~~~~
…/wfview/usbcontroller.h:26:44: note: in definition of macro ‘HID_API_MAKE_VERSION’
#define HID_API_MAKE_VERSION(mj, mn, p) (((mj) << 24) | ((mn) << 8) | (p))
^~
make: *** [Makefile:1385: usbcontroller.o] Fehler 1
make: *** Es wird auf noch nicht beendete Prozesse gewartet…

real 2m30.813s
user 4m29.831s
sys 0m19.973s
Error in make step.
wfview was not compiled.
Please consider posting the error(s) to https://forum.wfview.org/

73 Ralph

That looks like you have a very old version of hidapi installed on your machine. If you aren’t going to be using a USB controller (Shuttle/RC28) then comment-out the line USB_CONTROLLER at the start of wfview.pro and re-run qmake and make.

Alternatively, you will need to download and build hidapi.

73 Phil M0VSE

Can you show us the entire build output? Maybe there’s another error causing this one?

–E
de W6EL

Initially, I had the same errors in usbcontroller.cpp. I then tried to install a newer hidapi:
sudo apt update
sudo apt install libhidapi-hidraw0 libhidapi-libusb0
which said I already had the latest versions.

I then tried compiling hidapi:
git clone GitHub - libusb/hidapi: A Simple library for communicating with HID devices on Linux, Mac and Windows.
cd hidapi
./bootstrap
./configure

then sudo apt install the libs that configure tells you to install

./configure
make
sudo make install
I didn’t get any libs from this step.

Re-running the wfview compile script, I got several identical errors from the compiler for usbcontroller.cpp and from the linker for usbcontroller.o:
undefined reference to hid_version

What is the fix for this?
Gary
W9TD

Hi Gary,

I’m seeing the same thing on some of my computers.

It has to do with how the HIDAPI changed the method by which they identify the version of the code. There’s some code in wfview that makes a note of the version and that is what’s failing. I think we can fix it with some careful code on our side.

It’s really quite annoying that the library did this in an incompatible way, as the entire point of having version numbers is to help people make their code more compatible!

Hang in there, we will find a fix for this.

–E
de W6EL

hi Elliott

I can post the complete script in the evening 20 UTC :slight_smile:

73 Ralph

where can i put the build? it’s big with 30444 characters…

73 Ralph

Hi Ralph,

Don’t worry about it. We found a thing which is likely the cause of it. When it merges to master then you can try building again. I’ll let you know soon.

—E
de W6EL

Ok, the fix is pushed to master for hidapi.

Please pull a fresh copy of the source and try again. If it works on my ancient computer it ought to work on yours :-).

Also I should clarify my earlier comment, the older version of the HID API doesn’t have any version information. It’s not that they changed the method, they just added one where previously there wasn’t one.

–E

i am still getting the undefined reference to hid_version error on the pi.
Gary
W9TD

hello everyone,

compiling worked :slight_smile: everything works, only my chromium browser and starting the pi cause problems. I don’t think it’s because of the installation of wfview. I think my sd card is causing problems. I’ll try another SD card and get back to you. many thanks for your help :slight_smile:
73 Ralph

Glad to hear it!

–E
de W6EL

Hi Gary,

I have updated the build script to include the source revision. Can you please download a new copy of the build script, run it, and provide us with the output text?

We need to see all the text. Every bit of it.

I’m a little concerned that you may have created a situation where you have two conflicting libraries on your system. But try the new script and see how it goes.

Thanks,

–E
de W6EL

Hi Gary,

I just did some additional edits to the build script, and now, if a build fails, it will send a log of the failure to termbin.

First remove your existing fullbuild-wfview.sh script. Next, download the latest fullbuild-wfview.sh script and run it. It will give you a URL at the end, give us the URL.

–E

Elliot
https://termbin.com/3ujl
I deleted the script and the prior source directory and your new script gave this url, but it still failed with undefined references to hid_version.
Gary
W9TD

Hi Gary,

Thank you, I can see it pretty clearly now.

I believe you have two versions of hidapi installed at once somehow. My guess is the header and the library are not matching.

I recommend you try to remove the one you manually installed, purge the default ones from the OS, and then install only the ones from the OS again.

Now, I have not tried these steps, but I think they would be:

  1. cd to where you build hidapi, for example cd ~/Downloads/hidapi
  2. run sudo make uninstall
  3. sudo apt purge libhidapi-hidraw0 libhidapi-libusb0 libhidapi-dev
  4. sudo apt install libhidapi-hidraw0 libhidapi-libusb0 libhidapi-dev

If these commands give you discomfort, I’d consider reinstalling on the Pi as I don’t really feel like I know exactly what configuration your Pi is in at this point. wfview has been patched to work on all versions of hidapi, as far as we know.

–E

Elliott,
I uninstalled the ~/Downloads/hidapi and deleted the directory
To do the purge you suggested would have removed a bunch of other software so I didn’t do it.
Wfview compiles OK now and was installed and runs fine after only a brief review
Thanks
Gary
W9TD

That’s good news, Gary! I’m glad it’s working for you. Thanks for evolving our build script too.

—E
de W6EL