Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libhid is dead #3

Open
NoraCodes opened this issue Dec 26, 2015 · 17 comments
Open

libhid is dead #3

NoraCodes opened this issue Dec 26, 2015 · 17 comments

Comments

@NoraCodes
Copy link

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

@andrew-codechimp
Copy link

I had the same issue as your. If you follow this thread you should be able to get it working ok.
#1

@fkrauthan
Copy link

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.

@kost
Copy link
Owner

kost commented Jan 2, 2020

Submit pull request!

@fkrauthan
Copy link

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

@Sagestum
Copy link

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

@fkrauthan
Copy link

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

@Sagestum
Copy link

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.

@fkrauthan
Copy link

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

@Sagestum
Copy link

Sagestum commented Sep 15, 2021

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".`

@fkrauthan
Copy link

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.

@Sagestum
Copy link

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

@fkrauthan
Copy link

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.

@Sagestum
Copy link

Sagestum commented Sep 15, 2021

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?

@fkrauthan
Copy link

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

@Sagestum
Copy link

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

@fkrauthan
Copy link

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.

@Sagestum
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants