Open MiguelVSantos opened 6 years ago
Hi, could you solve it? Regards
i got the same error in MATLAB 2017b ,if you find the solution please let me know . Thanks.
Hey, I had the same issue with MATLAB R2017B. The file libhackrf.lib cannot be empty, since MATLAB use it for compiling with MEX. I found a way to easily create a valid libhackrf.lib file using Microsoft Visual C++ ("MSVC"):
Call a new MSVC console (e.g. for "Visual Studio 2019": Start a new command line window and call the batch-script from "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community \VC\Auxiliary\Build\vcvars64.bat")
Change directory to "deps\bin\" and run:
dumpbin /EXPORTS libhackrf.dll > libhackrf.exports
Create a new file called "libhackrf.def" and insert the following lines:
LIBRARY "libhackrf.dll"
EXPORTS
hackrf_board_id_name
hackrf_xxx
... for _hackrfxxx insert each "hackrf_" element from your previously created "libhackrf.exports" file
In your MSVC console type the command:
lib /def:libhackrf.def /machine:x64 /out:libhackrf.lib
If you now run make in MATLAB it should compile without any problems
Regards
thank you for your reply
On Sun, Aug 4, 2019 at 10:44 PM AustrianCodeWriter notifications@github.com wrote:
Hey, I had the same issue with MATLAB R2017B. The file libhackrf.lib cannot be empty, since MATLAB use it for compiling with MEX. I found a way to easily create a valid libhackrf.lib file using Microsoft Visual C++ ("MSVC"):
- Call a new MSVC console (e.g. for "Visual Studio 2019": Start a new command line window and call the batch-script from "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community \VC\Auxiliary\Build\vcvars64.bat")
- Change directory to "deps\bin" and run: dumpbin /EXPORTS libhackrf.dll > libhackrf.exports
Create a new file called "libhackrf.def" and insert the following lines:
LIBRARY "libhackrf.dll" EXPORTS hackrf_board_id_name hackrf_xxx
... for _hackrfxxx insert each "hackrf_" element from your previously created "libhackrf.exports" file
1.
In your MSVC console type the command: lib /def:libhackrf.def /machine:x64 /out:libhackrf.lib 2.
If you now run make in MATLAB it should compile without any problems
Regards
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kit-cel/simulink-hackrf/issues/11?email_source=notifications&email_token=AKEQA6ZZUFRMNA6W6BDA7Y3QC4FALA5CNFSM4F7QYSZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3QF2OA#issuecomment-518020408, or mute the thread https://github.com/notifications/unsubscribe-auth/AKEQA63GQATBIQS7GCQGVWLQC4FALANCNFSM4F7QYSZQ .
Hi, I've tried to compile but afeter i added the empty libhackrf.lib file i get this error:
C:\hackrf_one\simulink-hackrf-1.0\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')
btw i'm using MATLAB R2018a any idea? regards