0

我正在编写一个 c++ 文件以构建到 mex 中,但是我使用 asio 函数(如“ASIOExit”)得到了未解决的外部符号错误。我正在使用 mex 命令在 Matlab 控制台中构建。我已经从 AsioSDK 中放置了所有头文件和 cppfile。放入一个文件夹广告使用 -I 包含该文件夹。我还需要包含或链接什么?

与 ASIO 相关的 3 个头文件已经添加到 include 中。

#include "asiosys.h" 
#include "asio.h"
#include "asiodrivers.h"

使用 mex 创建库 hostsample.lib 和对象 hostsample.exp hostsample.obj 时出错:错误 LNK2019:无法解析的外部符号“long __cdecl ASIOInit(struct ASIODriverInfo *)”(?ASIOInit@@YAJPEAUASIODriverInfo@@@Z) 在函数 mexFunction hostsample 中引用。 obj:错误 LNK2019:未解析的外部符号“long __cdecl ASIOExit(void)”(?ASIOExit@@YAJXZ) 在函数 mexFunction hostsample.obj 中引用:错误 LNK2019:未解析的外部符号“long __cdecl ASIOStart(void)”(?ASIOStart@@ YAJXZ)在函数 mexFunction hostsample.obj 中引用:错误 LNK2019:未解析的外部符号“long __cdecl ASIOStop(void)”(?ASIOStop@@YAJXZ)在函数 mexFunction hostsample.obj 中引用:错误 LNK2019:未解析的外部符号“long __cdecl ASIOGetChannels(长 *,long *)" (?ASIOGetChannels@@YAJPEAJ0@Z) 在函数 "long __cdecl init_asio_static_data(struct DriverInfo *)" (?init_asio_static_data@@YAJPEAUDriverInfo@@@Z) hostsample.obj 中引用:错误 LNK2019:无法解析的外部符号 "long __cdecl ASIOGetLatencies(long *,long *)" (?ASIOGetLatencies@@YAJPEAJ0@Z) 在函数 "long __cdecl create_asio_buffers(struct DriverInfo *)" (?create_asio_buffers@@YAJPEAUDriverInfo@@@Z) hostsample.obj 中引用:错误 LNK2019:未解决在函数“long __cdecl init_asio_static_data(struct DriverInfo *)”(?init_asio_static_data@@YAJPEAUDriverInfo@@)中引用的外部符号“long __cdecl ASIOGetBufferSize(long *,long *,long *,long *)” @Z) hostsample.obj:错误 LNK2019:未解析的外部符号“long __cdecl ASIOGetSampleRate(double *)" (?ASIOGetSampleRate@@YAJPEAN@Z) 在函数“long __cdecl init_asio_static_data(struct DriverInfo *)”(?init_asio_static_data@@YAJPEAUDriverInfo@@@Z) hostsample.obj 中引用:错误 LNK2019:未解决的外部函数“long __cdecl init_asio_static_data(struct DriverInfo *)”(?init_asio_static_data@@YAJPEAUDriverInfo@@@Z) 中引用的符号“long __cdecl ASIOSetSampleRate(double)”(?ASIOSetSampleRate@@YAJN@Z) hostsample.obj:错误 LNK2019:未解决函数“void __cdecl bufferSwitch(long,long)”(?bufferSwitch@@YAXJJ@)中引用的外部符号“long __cdecl ASIOGetSamplePosition(struct ASIOSamples *,struct ASIOTimeStamp *)” Z)hostsample.obj:错误 LNK2019:未解析的外部符号“long __cdecl ASIOGetChannelInfo(struct ASIOChannelInfo *)”(?ASIOGetChannelInfo@@YAJPEAUASIOChannelInfo@@@Z) 在函数“long __cdecl create_asio_buffers(struct DriverInfo *)”(?create_asio_buffers@@YAJPEAUDriverInfo@@@Z) 中引用) hostsample.obj : 错误 LNK2019: 在函数 "long __cdecl create_asio_buffers (struct DriverInfo *)" (?create_asio_buffers@@YAJPEAUDriverInfo@@@Z) hostsample.obj:错误 LNK2019:未解析的外部符号“long __cdecl ASIODisposeBuffers(void)”(?ASIODisposeBuffers@@YAJXZ) 在函数 mexFunction hostsample.obj 中引用:错误 LNK2019:在函数“struct ASIOTime * __cdecl bufferSwitchTimeInfo(struct ASIOTime *,长,长,类 std::vector

,class std::allocator > > >)" (?bufferSwitchTimeInfo@@YAPEAUASIOTime@@PEAU1@JJV?$vector@V?$vector@NV?$allocator@N@std@@@std@@V?$allocator@ V?$vector@NV?$allocator@N@std@@@std@@@2@@std@@@Z) hostsample.obj:错误 LNK2019:函数“struct ASIOTime * __cdecl bufferSwitchTimeInfo( struct ASIOTime *,long,long,class std::vector ,class std::allocator > > >)" (?bufferSwitchTimeInfo@@YAPEAUASIOTime@@PEAU1@JJV?$vector@V?$vector@NV?$allocator@N @std@@@std@@V?$allocator@V?$vector@NV?$allocator@N@std@@@std@@@2@@std@@@Z) hostsample.obj:错误 LNK2019:未解决外部符号“public: void __cdecl AsioDrivers::removeCurrentDriver(void)”(?removeCurrentDriver@AsioDrivers@@QEAAXXZ) 在函数 mexFunction hostsample.obj 中引用:错误 LNK2019:未解析的外部符号“bool __cdecl loadAsioDriver(char *)”(?loadAsioDriver@@YA_NPEAD@Z) 在函数 mexFunction hostsample.obj 中引用:错误LNK2019:函数“void __cdecl bufferSwitch(long,long)”中引用的未解析外部符号“struct ASIOTime * __cdecl bufferSwitchTimeInfo(struct ASIOTime *,long,long)”(?bufferSwitchTimeInfo@@YAPEAUASIOTime@@PEAU1@JJ@Z) bufferSwitch@@YAXJJ@Z) hostsample.obj:错误 LNK2019:在函数 mexFunction hostsample.mexw64 中引用的未解析的外部符号“class AsioDrivers * asioDrivers”(?asioDrivers@@3PEAVAsioDrivers@@EA):致命错误 LNK1120:19 个未解析的外部错误 LNK2019:未解析的外部符号“bool __cdecl loadAsioDriver(char *)”(?loadAsioDriver@@YA_NPEAD@Z) 在函数 mexFunction hostsample.obj 中引用:错误 LNK2019:未解析的外部符号“struct ASIOTime * __cdecl bufferSwitchTimeInfo(struct ASIOTime *,long ,long)" (?bufferSwitchTimeInfo@@YAPEAUASIOTime@@PEAU1@JJ@Z) 在函数 "void __cdecl bufferSwitch(long,long)" (?bufferSwitch@@YAXJJ@Z) hostsample.obj 中引用:错误 LNK2019:未解析的外部符号在函数 mexFunction hostsample.mexw64 中引用的“类 AsioDrivers * asioDrivers”(?asioDrivers@@3PEAVAsioDrivers@@EA):致命错误 LNK1120:19 个未解决的外部错误 LNK2019:未解析的外部符号“bool __cdecl loadAsioDriver(char *)”(?loadAsioDriver@@YA_NPEAD@Z) 在函数 mexFunction hostsample.obj 中引用:错误 LNK2019:未解析的外部符号“struct ASIOTime * __cdecl bufferSwitchTimeInfo(struct ASIOTime *,long ,long)" (?bufferSwitchTimeInfo@@YAPEAUASIOTime@@PEAU1@JJ@Z) 在函数 "void __cdecl bufferSwitch(long,long)" (?bufferSwitch@@YAXJJ@Z) hostsample.obj 中引用:错误 LNK2019:未解析的外部符号在函数 mexFunction hostsample.mexw64 中引用的“类 AsioDrivers * asioDrivers”(?asioDrivers@@3PEAVAsioDrivers@@EA):致命错误 LNK1120:19 个未解决的外部(?loadAsioDriver@@YA_NPEAD@Z) 在函数 mexFunction hostsample.obj 中引用:错误 LNK2019:未解析的外部符号“struct ASIOTime * __cdecl bufferSwitchTimeInfo(struct ASIOTime *,long,long)”(?bufferSwitchTimeInfo@@YAPEAUASIOTime@@PEAU1@JJ @Z) 在函数 "void __cdecl bufferSwitch(long,long)" (?bufferSwitch@@YAXJJ@Z) hostsample.obj 中引用:错误 LNK2019:未解析的外部符号 "class AsioDrivers * asioDrivers" (?asioDrivers@@3PEAVAsioDrivers@@EA ) 在函数 mexFunction hostsample.mexw64 中引用:致命错误 LNK1120: 19 unresolved externals(?loadAsioDriver@@YA_NPEAD@Z) 在函数 mexFunction hostsample.obj 中引用:错误 LNK2019:未解析的外部符号“struct ASIOTime * __cdecl bufferSwitchTimeInfo(struct ASIOTime *,long,long)”(?bufferSwitchTimeInfo@@YAPEAUASIOTime@@PEAU1@JJ @Z) 在函数 "void __cdecl bufferSwitch(long,long)" (?bufferSwitch@@YAXJJ@Z) hostsample.obj 中引用:错误 LNK2019:未解析的外部符号 "class AsioDrivers * asioDrivers" (?asioDrivers@@3PEAVAsioDrivers@@EA ) 在函数 mexFunction hostsample.mexw64 中引用:致命错误 LNK1120: 19 unresolved externals(?bufferSwitchTimeInfo@@YAPEAUASIOTime@@PEAU1@JJ@Z) 在函数“void __cdecl bufferSwitch(long,long)”(?bufferSwitch@@YAXJJ@Z) hostsample.obj 中引用:错误 LNK2019:未解析的外部符号“类 AsioDrivers * asioDrivers" (?asioDrivers@@3PEAVAsioDrivers@@EA) 在函数 mexFunction hostsample.mexw64 中引用:致命错误 LNK1120:19 个未解决的外部(?bufferSwitchTimeInfo@@YAPEAUASIOTime@@PEAU1@JJ@Z) 在函数“void __cdecl bufferSwitch(long,long)”(?bufferSwitch@@YAXJJ@Z) hostsample.obj 中引用:错误 LNK2019:未解析的外部符号“类 AsioDrivers * asioDrivers" (?asioDrivers@@3PEAVAsioDrivers@@EA) 在函数 mexFunction hostsample.mexw64 中引用:致命错误 LNK1120:19 个未解决的外部

4

1 回答 1

0

好的,看起来我没有在解决方案中包含所有 cpp 和 h 文件。

于 2019-12-11T09:57:30.897 回答