kit-cel / simulink-hackrf

Simulink blockset and MATLAB functions to interface with HackRF devices in real-time
GNU General Public License v3.0
44 stars 22 forks source link

fatal error: libusb.h: No su ch file or directory #3

Closed stackprogramer closed 7 years ago

stackprogramer commented 7 years ago

when i want to install on win8.1 in mingw32-make it returns:

K:\hackrf-master\host\libhackrf\src\hackrf.c:28:20: fatal error: libusb.h: No su ch file or directory compilation terminated. CMakeFiles\hackrf.dir\build.make:61: recipe for target 'CMakeFiles/hackrf.dir/ha ckrf.obj' failed mingw32-make[2]: [CMakeFiles/hackrf.dir/hackrf.obj] Error 1 CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/hackrf.dir/all' failed mingw32-make[1]: [CMakeFiles/hackrf.dir/all] Error 2 Makefile:126: recipe for target 'all' failed mingw32-make: *** [all] Error 2

i set cmake gui with this image config: https://drive.google.com/open?id=0Bxkt-d32S34gT3pMSVVWM1FVU1E

any idea,thanks in advance

stackprogramer commented 7 years ago

i copy header file usb.h to include directory and libusb-1.0.a to lib directory mingw but it error directory is solved but return errors: apart of error s in below even i set cmake varrible with mingw64/static we have this errrors:

$ mingw32-make [ 25%] Linking C shared library libhackrf.dll CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0xa6): undefined ref erence to libusb_cancel_transfer@4' CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0x106): undefined re ference tolibusb_free_transfer@4' CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0x1b2): undefined re ference to libusb_alloc_transfer@4' CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0x2d3): undefined re ference tolibusb_submit_transfer@4' CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0x317): undefined re ference to libusb_get_device@4' CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0x32f): undefined re ference tolibusb_get_active_config_descriptor@8' CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0x365): undefined re ference to libusb_free_config_descriptor@4' CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0x383): undefined re ference tolibusb_kernel_driver_active@8' CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0x3c3): undefined re ference to libusb_detach_kernel_driver@8' CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0x409): undefined re ference tolibusb_get_configuration@8' CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0x457): undefined re ference to libusb_set_configuration@8' CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0x4b4): undefined re ference tolibusb_init@4' CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0x4f2): undefined re ference to libusb_exit@4' CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0x569): undefined re ference tolibusb_get_device_list@8' CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0x62a): undefined re . and so on ....

stackprogramer commented 7 years ago

when i set to /mingw32/dll it can make but in matlab it returns

Error using mex C:/MATLAB/SupportPackages/R2016a/MW_MinGW_4_9/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible K:\simulink-hackrf-1.0\deps\bin/libhackrf.dll.a when searching for -llibhackrf K:\simulink-hackrf-1.0\deps\bin/libhackrf.lib: file not recognized: File truncated collect2.exe: error: ld returned 1 exit status

Error in make (line 66) mex(options{:}, 'src/hackrf_find_devices.c')

for building src when i add lib mingw32/static/ it returns

K:/libhackrf/libusb/MinGW32/static/libusb-1.0.a(libusb_1_0_la-core.o):core.c:(.t ext+0xd3): undefined reference to __ms_vsnprintf' K:/libhackrf/libusb/MinGW32/static/libusb-1.0.a(libusb_1_0_la-core.o):core.c:(.t ext+0x625): undefined reference to__ms_vsnprintf' collect2.exe: error: ld returned 1 exit status CMakeFiles\hackrf.dir\build.make:96: recipe for target 'libhackrf.dll' failed mingw32-make[2]: [libhackrf.dll] Error 1 CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/hackrf.dir/all' failed mingw32-make[1]: [CMakeFiles/hackrf.dir/all] Error 2 Makefile:126: recipe for target 'all' failed mingw32-make: *** [all] Error 2

stackprogramer commented 7 years ago

i installed mingw-w64 supreately: it returns errors:

[ 25%] Building C object CMakeFiles/hackrf.dir/hackrf.obj [ 50%] Linking C shared library libhackrf.dll CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0x1e86): undefined r eference to pthread_join' CMakeFiles\hackrf.dir/objects.a(hackrf.obj):hackrf.c:(.text+0x1f49): undefined r eference topthread_create' collect2.exe: error: ld returned 1 exit status CMakeFiles\hackrf.dir\build.make:96: recipe for target 'libhackrf.dll' failed mingw32-make[2]: [libhackrf.dll] Error 1 CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/hackrf.dir/all' failed mingw32-make[1]: [CMakeFiles/hackrf.dir/all] Error 2 Makefile:126: recipe for target 'all' failed mingw32-make: *** [all] Error 2

stackprogramer commented 7 years ago

i used x86_64-6.3.0-posix-seh-rt_v5-rev2 instead x86_64-6.3.0-win32-seh-rt_v5-rev2 now it works like charm every thing is ok, i will shared a video how we can install it on windows soon, snapshot of hackrf source and sink in matlab https://drive.google.com/open?id=0Bxkt-d32S34gVjR6akRQSmxiLTA thanks

stackprogramer commented 7 years ago

i shared video install hackrf one on matlab https://www.youtube.com/watch?v=7dtikuo3BSw

skoslowski commented 7 years ago

thanks again for the video.

shanpriyan commented 5 years ago

when i set to /mingw32/dll it can make but in matlab it returns

Error using mex C:/MATLAB/SupportPackages/R2016a/MW_MinGW_4_9/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible K:\simulink-hackrf-1.0\deps\bin/libhackrf.dll.a when searching for -llibhackrf K:\simulink-hackrf-1.0\deps\bin/libhackrf.lib: file not recognized: File truncated collect2.exe: error: ld returned 1 exit status

Error in make (line 66) mex(options{:}, 'src/hackrf_find_devices.c')

for building src when i add lib mingw32/static/ it returns

K:/libhackrf/libusb/MinGW32/static/libusb-1.0.a(libusb_1_0_la-core.o):core.c:(.t ext+0xd3): undefined reference to __ms_vsnprintf' K:/libhackrf/libusb/MinGW32/static/libusb-1.0.a(libusb_1_0_la-core.o):core.c:(.t ext+0x625): undefined reference to__ms_vsnprintf' collect2.exe: error: ld returned 1 exit status CMakeFiles\hackrf.dir\build.make:96: recipe for target 'libhackrf.dll' failed mingw32-make[2]: [libhackrf.dll] Error 1 CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/hackrf.dir/all' failed mingw32-make[1]: [CMakeFiles/hackrf.dir/all] Error 2 Makefile:126: recipe for target 'all' failed mingw32-make: *** [all] Error 2

i got the same error , if you find the solution please let me know Thanks.

stackprogramer commented 5 years ago

https://www.youtube.com/watch?v=7dtikuo3BSw follow these steps....

arielkantorovich commented 5 years ago

HI, I try to start work hackrf with Simulink, I was assisted in the video on youtube :https://www.youtube.com/watch?v=lJz4ZqB_oCw&t=552s and I stuck I didn't find the directory libhackrf/build and because this I cant run cmake. I really need any help even a link to the file or a particular guide because I seem to be doing something wrong . Thank you very much:)