dcled icon indicating copy to clipboard operation
dcled copied to clipboard

libhid is dead

Open NoraCodes opened this issue 10 years ago • 17 comments

libHID is dead and, since 10.10, cannot be installed in Ubuntu. Please update to use libhidapi.

NoraCodes avatar Dec 26 '15 23:12 NoraCodes

I had the same issue as your. If you follow this thread you should be able to get it working ok. https://github.com/kost/dcled/issues/1

andrew-codechimp avatar Dec 28 '15 07:12 andrew-codechimp

I did do a test upgrade to libhidapi that at least on mac os works. I also upgraded the build system to CMake. If the repo owner is interest I can submit a pull request.

fkrauthan avatar Dec 31 '19 01:12 fkrauthan

Submit pull request!

kost avatar Jan 02 '20 07:01 kost

Take a look at #4 for the code changes. I did not adjust the READMEs but should be pretty self explanatory.

fkrauthan avatar Feb 06 '20 23:02 fkrauthan

Does not work for me on Ubuntu 20.04.3 LTS or Debian Buster on the Raspberry PI. I have installed the 'apt-get install libhid-dev' but it says it is not installed :(

gcc -c -g -O3 -DFONTDIR='"/usr/local/share/dcled"' -DDCLEDVERSION='"2.0"' dcled.c dcled.c:28:10: fatal error: hidapi.h: Datei oder Verzeichnis nicht gefunden 28 | #include <hidapi.h> | ^~~~~~~~~~ compilation terminated. make: *** [makefile:64: dcled.o] Fehler 1

Sagestum avatar Sep 15 '21 20:09 Sagestum

@Sagestum did you use cmake? It should actually throw an error in case it couldn't find hidapi?

fkrauthan avatar Sep 15 '21 20:09 fkrauthan

Yeah: `:~/dcled$ cmake . -- The C compiler identification is GNU 9.3.0 -- The CXX compiler identification is GNU 9.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find LibHIDAPI (missing: LIBHIDAPI_LIBRARY) Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE) cmake/FindLibHIDAPI.cmake:25 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:13 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/parallels/dcled/CMakeFiles/CMakeOutput.log". `

Maybe I have forgotten somethin importend, my build skills are very poor.

Sagestum avatar Sep 15 '21 20:09 Sagestum

libhid is not the same as libhidapi. You need to install libhidapi-dev

fkrauthan avatar Sep 15 '21 21:09 fkrauthan

libhidapi-dev is installed:

~/dcled$ sudo apt install libhidapi-dev [sudo] Passwort für parallels: Paketlisten werden gelesen... Fertig Abhängigkeitsbaum wird aufgebaut. Statusinformationen werden eingelesen.... Fertig libhidapi-dev ist schon die neueste Version (0.9.0+dfsg-1). Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt: libllvm11 linux-headers-5.4.0-80 linux-headers-5.4.0-80-generic linux-image-5.4.0-80-generic linux-modules-5.4.0-80-generic linux-modules-extra-5.4.0-80-generic Verwenden Sie »sudo apt autoremove«, um sie zu entfernen. 0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.

but still:

`~/dcled$ cmake . CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find LibHIDAPI (missing: LIBHIDAPI_LIBRARY) Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE) cmake/FindLibHIDAPI.cmake:25 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:13 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/parallels/dcled/CMakeFiles/CMakeOutput.log".`

Sagestum avatar Sep 15 '21 21:09 Sagestum

You probably have to figure out how you can tell cmake where it is installed as it claims that this library can't be found. I think by default the file should be in /usr/include/hidapi/hidapi.h.

fkrauthan avatar Sep 15 '21 21:09 fkrauthan

Yes, I can confirm that the file is there. /usr/include/hidapi/hidapi.h But I have no clue how to tell it where it is

Sagestum avatar Sep 15 '21 21:09 Sagestum

Try to run find /usr/lib -name "libhidapi.a" to see where it stored the lib file. That seem to be the file it can not find in your case.

fkrauthan avatar Sep 15 '21 21:09 fkrauthan

This file could not be found. I have search the complete disk, but nothing. I have startet to search via apt-file, but it could find it.

But:

~/dcled$ sudo apt-file search libhidapi libhidapi-dev: /usr/lib/aarch64-linux-gnu/libhidapi-hidraw.a libhidapi-dev: /usr/lib/aarch64-linux-gnu/libhidapi-hidraw.so libhidapi-dev: /usr/lib/aarch64-linux-gnu/libhidapi-libusb.a libhidapi-dev: /usr/lib/aarch64-linux-gnu/libhidapi-libusb.so libhidapi-dev: /usr/share/doc/libhidapi-dev/AUTHORS.txt libhidapi-dev: /usr/share/doc/libhidapi-dev/README.md.gz libhidapi-dev: /usr/share/doc/libhidapi-dev/changelog.Debian.gz libhidapi-dev: /usr/share/doc/libhidapi-dev/copyright libhidapi-hidraw0: /usr/lib/aarch64-linux-gnu/libhidapi-hidraw.so.0 libhidapi-hidraw0: /usr/lib/aarch64-linux-gnu/libhidapi-hidraw.so.0.0.0 libhidapi-hidraw0: /usr/share/doc/libhidapi-hidraw0/changelog.Debian.gz libhidapi-hidraw0: /usr/share/doc/libhidapi-hidraw0/copyright libhidapi-libusb0: /usr/lib/aarch64-linux-gnu/libhidapi-libusb.so.0 libhidapi-libusb0: /usr/lib/aarch64-linux-gnu/libhidapi-libusb.so.0.0.0 libhidapi-libusb0: /usr/share/doc/libhidapi-libusb0/changelog.Debian.gz libhidapi-libusb0: /usr/share/doc/libhidapi-libusb0/copyright

Maybe the file was renamed?

Sagestum avatar Sep 15 '21 21:09 Sagestum

Ah ok can you use my latest commit. I modified the cmake scripts a bit which might fix the issue you have.

fkrauthan avatar Sep 15 '21 21:09 fkrauthan

cmake now runs, but sadly make fails.

~/dcled$ cmake . -- The C compiler identification is GNU 9.3.0 -- The CXX compiler identification is GNU 9.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found LibHIDAPI: /usr/lib/aarch64-linux-gnu/libhidapi-libusb.so
-- found HIDAPI -- Configuring done -- Generating done -- Build files have been written to: /home/parallels/dcled

~/dcled$ make -f Makefile [ 50%] Linking C executable dcled /usr/bin/ld: CMakeFiles/dcled.dir/dcled.c.o: in function sqrtscale': dcled.c:(.text+0x2814): undefined reference to sqrt' /usr/bin/ld: dcled.c:(.text+0x283c): undefined reference to round' /usr/bin/ld: CMakeFiles/dcled.dir/dcled.c.o: in function firelinetach': dcled.c:(.text+0x2864): undefined reference to sqrt' /usr/bin/ld: dcled.c:(.text+0x29c4): undefined reference to round' /usr/bin/ld: CMakeFiles/dcled.dir/dcled.c.o: in function scrolltach': dcled.c:(.text+0x2c08): undefined reference to round' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/dcled.dir/build.make:85: dcled] Fehler 1 make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/dcled.dir/all] Fehler 2 make: *** [Makefile:130: all] Fehler 2

Sagestum avatar Sep 15 '21 22:09 Sagestum

Ok that error is now fixed as well. I've tested it inside a docker container but assume on a real linux system it will work too.

fkrauthan avatar Sep 15 '21 22:09 fkrauthan

Yes it is working again, thanks :D. I hope it will lasts another 10 years 👍 IMG_1159

Sagestum avatar Sep 15 '21 23:09 Sagestum