matlab用mex调用cuda未读入库文件

问题遇到的现象和发生背景

Matlab通过mex调用CUDA

问题相关代码,请勿粘贴截图

就是跑了matlab自带的测试文件mexGPUExample.cu

mex -v mexGPUExample.cu

运行结果及报错内容
错误使用 mex
  正在创建库 mexGPUExample.lib 和对象 mexGPUExample.exp
mexGPUExample.obj : error LNK2019: 无法解析的外部符号 mxInitGPU,函数 mexFunction 中引用了该符号
mexGPUExample.obj : error LNK2019: 无法解析的外部符号 mxIsGPUArray,函数 mexFunction 中引用了该符号
mexGPUExample.obj : error LNK2019: 无法解析的外部符号 mxGPUCreateFromMxArray,函数 mexFunction 中引用了该符号
mexGPUExample.obj : error LNK2019: 无法解析的外部符号 mxGPUCreateGPUArray,函数 mexFunction 中引用了该符号
mexGPUExample.obj : error LNK2019: 无法解析的外部符号 mxGPUGetClassID,函数 mexFunction 中引用了该符号
mexGPUExample.obj : error LNK2019: 无法解析的外部符号 mxGPUGetComplexity,函数 mexFunction 中引用了该符号
mexGPUExample.obj : error LNK2019: 无法解析的外部符号 mxGPUGetData,函数 mexFunction 中引用了该符号
mexGPUExample.obj : error LNK2019: 无法解析的外部符号 mxGPUGetDataReadOnly,函数 mexFunction 中引用了该符号
mexGPUExample.obj : error LNK2019: 无法解析的外部符号 mxGPUGetDimensions,函数 mexFunction 中引用了该符号
mexGPUExample.obj : error LNK2019: 无法解析的外部符号 mxGPUGetNumberOfDimensions,函数 mexFunction 中引用了该符号
mexGPUExample.obj : error LNK2019: 无法解析的外部符号 mxGPUGetNumberOfElements,函数 mexFunction 中引用了该符号
mexGPUExample.obj : error LNK2019: 无法解析的外部符号 mxGPUCreateMxArrayOnGPU,函数 mexFunction 中引用了该符号
mexGPUExample.obj : error LNK2019: 无法解析的外部符号 mxGPUDestroyGPUArray,函数 mexFunction 中引用了该符号
mexGPUExample.mexw64 : fatal error LNK1120: 13 个无法解析的外部命令

我的解答思路和尝试过的方法

这个应该是找不到库文件
尝试过手动读入库文件的预处理命令

#pragma comment (lib, "xxx.lib")

可以跑
尝试过改用mexcuda 也成功了
但是这是测试文件,只能说明问题出在这一步
现在需要跑通另一段代码,不能加预处理命令或者换用mexcuda,有什么方法可以链接到 CUDA 库中吗

我想要达到的结果

应该是修改配置里的某个lib路径,或者添加库目录来解决这个问题,希望找到这个解决的办法

打开原 .c 文件,按Ctrl + F,找到程序中的名字“mxInitGPU”,将其修改为“mexInitGPU”,保存。其它也做同样修改,再在MATLAB中重新进行编译即可。