【发布时间】:2020-03-10 15:51:43
【问题描述】:
我正在编写一个 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:未解决的外部 符号“长__cdecl ASIOInit(结构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 *,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 ASIOGetBufferSize(long *,long *,long *,long *)" (?ASIOGetBufferSize@@YAJPEAJ000@Z) 在函数“long”中引用 __cdecl init_asio_static_data(struct DriverInfo *)" (?init_asio_static_data@@YAJPEAUDriverInfo@@@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 ASIOSetSampleRate(double)" (?ASIOSetSampleRate@@YAJN@Z) 在函数“long”中引用 __cdecl init_asio_static_data(struct DriverInfo *)" (?init_asio_static_data@@YAJPEAUDriverInfo@@@Z) hostsample.obj : 错误 LNK2019:未解析的外部符号“long __cdecl ASIOGetSamplePosition(struct ASIOSamples *,struct ASIOTimeStamp *)" (?ASIOGetSamplePosition@@YAJPEAUASIOSamples@@PEAUASIOTimeStamp@@@Z) 在函数“void __cdecl bufferSwitch(long,long)”中引用 (?bufferSwitch@@YAXJJ@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 ASIOCreateBuffers(struct ASIOBufferInfo *,long,long,struct ASIOCallbacks *)" (?ASIOCreateBuffers@@YAJPEAUASIOBufferInfo@@JJPEAUASIOCallbacks@@@Z) 在函数“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: 未解析的外部符号“long __cdecl ASIOOutputReady(void)” (?ASIOOutputReady@@YAJXZ) 在函数“struct ASIOTime * __cdecl bufferSwitchTimeInfo(struct ASIOTime *,long,long,class std::vector
,类 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:未解析的外部符号 __imp_timeGetTime 在函数“struct ASIOTime * __cdecl bufferSwitchTimeInfo(struct ASIOTime *,long,long,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:未解析的外部符号“公共: void __cdecl AsioDrivers::removeCurrentDriver(void)" (?removeCurrentDriver@AsioDrivers@@QEAAXXZ) 在函数中引用 mexFunction hostsample.obj:错误 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:未解决 外部符号“类 AsioDrivers * asioDrivers” (?asioDrivers@@3PEAVAsioDrivers@@EA) 在函数中引用 mexFunction hostsample.mexw64:致命错误 LNK1120:19 未解决 外在
【问题讨论】:
标签: c++ matlab build mex steinberg-asio