Getting reference errors when trying to install gem on Windows #704

Closed
opened 2024-10-18 13:22:49 -05:00 by andrewherron · 1 comment
andrewherron commented 2024-10-18 13:22:49 -05:00 (Migrated from github.com)

I'm using 2.7.x right now, but I've also tried this on the latest 3.x version and getting the same results. After copying the header files to the right spot in the ruby/mingw folder, I'm getting this error during install:

compiling myhidapi.c
linking shared-object myhidapi.so
C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0xa7): undefined reference to `hid_set_nonblocking'
C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x127): undefined reference to `hid_read_timeout'
C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x1a8): undefined reference to `hid_read'
C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x219): undefined reference to `hid_write'
C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x277): undefined reference to `hid_open_path'
C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x2c5): undefined reference to `hid_open'
C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x35e): undefined reference to `hid_enumerate'
C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x474): undefined reference to `hid_free_enumeration'
C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x508): undefined reference to `hid_get_product_string'
C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x5a8): undefined reference to `hid_get_manufacturer_string'
C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x1): undefined reference to `hid_close'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:263: myhidapi.so] Error 1
I'm using 2.7.x right now, but I've also tried this on the latest 3.x version and getting the same results. After copying the header files to the right spot in the ruby/mingw folder, I'm getting this error during install: ``` compiling myhidapi.c linking shared-object myhidapi.so C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0xa7): undefined reference to `hid_set_nonblocking' C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x127): undefined reference to `hid_read_timeout' C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x1a8): undefined reference to `hid_read' C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x219): undefined reference to `hid_write' C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x277): undefined reference to `hid_open_path' C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x2c5): undefined reference to `hid_open' C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x35e): undefined reference to `hid_enumerate' C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x474): undefined reference to `hid_free_enumeration' C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x508): undefined reference to `hid_get_product_string' C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x5a8): undefined reference to `hid_get_manufacturer_string' C:/Ruby27-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: myhidapi.o:myhidapi.c:(.text+0x1): undefined reference to `hid_close' collect2.exe: error: ld returned 1 exit status make: *** [Makefile:263: myhidapi.so] Error 1 ```
mcuee commented 2024-10-18 18:15:05 -05:00 (Migrated from github.com)

This does not belong to libusb project. You may want to ask in the Ruby binding project.

This does not belong to libusb project. You may want to ask in the Ruby binding project.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi#704
No description provided.