找不到与UHD(USRP硬件驱动程序)关联的目标文件 [英] Object file associated with UHD (USRP Hardware Driver) not found

查看:523
本文介绍了找不到与UHD(USRP硬件驱动程序)关联的目标文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编译一个使用MATLAB中的UHD(USRP硬件驱动程序)实用程序的C ++文件.这与尝试在具有Windows 10操作系统的64位系统上使用名为NI-2954R的USRP和MATLAB 2013b有关.

I am trying to compile a C++ file that uses the utilities of UHD (USRP Hardware Driver) in MATLAB. This is in connection with trying to use a USRP called NI-2954R with MATLAB 2013b on a 64-bit system with windows 10 OS.

以下是mex命令:

mex -largeArrayDims -v -g rx_samples_to_file.cpp   -I. "C:\Users\VINAYAK KARANDIKAR\Documents\MATLAB\MATLAB\Thesis\MATLAB_USRP_INTERFACE\UHD_sample_programs_from_GitHub\uhd"...
    -I."C:\Users\VINAYAK KARANDIKAR\Documents\MATLAB\MATLAB\Thesis\MATLAB_USRP_INTERFACE\UHD_sample_programs_from_GitHub\boost_1_55_0\boost"...
    -L."C:\Program Files\MATLAB\R2013b\extern\lib\win64\microsoft"  ...
     uhd.lib  ...
     uhd.lib libmx.lib libmex.lib libmat.lib ...
    "C:\Program Files\MATLAB\R2013b\extern\lib\win64\microsoft"

我收到以下错误:

LINK : fatal error LNK1181: cannot open input file 'C:\Users\VINAYAK KARANDIKAR\Documents\MATLAB\MATLAB\Thesis\MATLAB_USRP_INTERFACE\UHD_sample_programs_from_GitHub\uhd.obj' 

  C:\PROGRA~1\MATLAB\R2013B\BIN\MEX.PL: Error: Link of 'rx_samples_to_file.mexw64' failed. 

Unable to complete successfully.

Error in make_rx_samples_to_file (line 4)
mex -largeArrayDims -v -g rx_samples_to_file.cpp   -I. "C:\Users\VINAYAK
KARANDIKAR\Documents\MATLAB\MATLAB\Thesis\MATLAB_USRP_INTERFACE\UHD_sample_programs_from_GitHub\uhd

为什么会出现此错误,如何解决该编译问题?

Why do I get this error and how can I fix the compilation?

推荐答案

您的MEX命令有一些重复的部分,我认为这是由于复制粘贴错误引起的.我会假设您实际使用过:

Your MEX-command has some duplicated parts, I will assume this is because of copy-paste errors. I will assume you actually used:

mex -largeArrayDims -v -g rx_samples_to_file.cpp ...
    -I. "C:\Users\VINAYAK KARANDIKAR\Documents\MATLAB\MATLAB\Thesis\MATLAB_USRP_INTERFACE\UHD_sample_programs_from_GitHub\uhd"...
    -I."C:\Users\VINAYAK KARANDIKAR\Documents\MATLAB\MATLAB\Thesis\MATLAB_USRP_INTERFACE\UHD_sample_programs_from_GitHub\boost_1_55_0\boost"...
    -L."C:\Program Files\MATLAB\R2013b\extern\lib\win64\microsoft"  ...
     uhd.lib libmx.lib libmex.lib libmat.lib

您有一个参数-I.,指示您要将当前目录(.)添加到编译器的include路径,然后是另一个参数"C:\Users\VINAYAK KARANDIKAR\Documents\MATLAB\MATLAB\Thesis\MATLAB_USRP_INTERFACE\UHD_sample_programs_from_GitHub\uhd",指示您要将该文件添加到编译中.因此,mex将查找文件uhd.obj,该文件不存在.

You have an argument -I., indicating you want to add the current directory (.) to the compiler's include path, then another argument "C:\Users\VINAYAK KARANDIKAR\Documents\MATLAB\MATLAB\Thesis\MATLAB_USRP_INTERFACE\UHD_sample_programs_from_GitHub\uhd", indicating you want to add that file to the compilation. Consequently, mex will look for a file uhd.obj, which does not exist.

解决方案是不使用空格分隔-I参数的两个部分,并且不要在-I参数之后添加.(在-L参数中也有此符号).这导致:

The solution is to not separate the two parts of the -I argument with a space, and not add a . after the -I argument (you also have this in the -L argument). This leads to:

mex -largeArrayDims -v -g rx_samples_to_file.cpp ...
    -I"C:\Users\VINAYAK KARANDIKAR\Documents\MATLAB\MATLAB\Thesis\MATLAB_USRP_INTERFACE\UHD_sample_programs_from_GitHub\uhd" ...
    -I"C:\Users\VINAYAK KARANDIKAR\Documents\MATLAB\MATLAB\Thesis\MATLAB_USRP_INTERFACE\UHD_sample_programs_from_GitHub\boost_1_55_0\boost" ...
    -L"C:\Program Files\MATLAB\R2013b\extern\lib\win64\microsoft"  ...
     uhd.lib libmx.lib libmex.lib libmat.lib

尽管我对此感到惊讶,但是如果您查看 mex命令的文档,您将看到推荐的语法为:

Though I'm sort of surprised that this works in MATLAB, if you look at the documentation to the mex command you'll see that the recommended syntax would be:

mex -largeArrayDims -v -g rx_samples_to_file.cpp ...
    '-IC:\Users\VINAYAK KARANDIKAR\Documents\MATLAB\MATLAB\Thesis\MATLAB_USRP_INTERFACE\UHD_sample_programs_from_GitHub\uhd' ...
    '-IC:\Users\VINAYAK KARANDIKAR\Documents\MATLAB\MATLAB\Thesis\MATLAB_USRP_INTERFACE\UHD_sample_programs_from_GitHub\boost_1_55_0\boost' ...
    '-LC:\Program Files\MATLAB\R2013b\extern\lib\win64\microsoft'  ...
     uhd.lib libmx.lib libmex.lib libmat.lib

这篇关于找不到与UHD(USRP硬件驱动程序)关联的目标文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆