简体   繁体   English

ASIOSDK; 从 hostsample.cpp 构建 mex 文件时出错

[英]ASIOSDK; Error when building mex file from hostsample.cpp

I'm writing a c++ file to build into mex, but I got the unsolved external symbol errors with asio function like "ASIOExit".我正在编写一个 c++ 文件以构建到 mex 中,但是我得到了未解决的外部符号错误,例如“ASIOExit”。 I'm building in Matlab console with mex command.我正在使用 mex 命令在 Matlab 控制台中构建。 I've put all headfiles and cppfiles from the AsioSDK.我已经从 AsioSDK 中放置了所有头文件和 cppfile。 into one folder ad used -I to include that folder.放入一个文件夹广告使用 -I 包含该文件夹。 What else do I need to include or link?我还需要包含或链接什么?

The 3 headfiles related to ASIO has already been added in include.与 ASIO 相关的 3 个头文件已经添加到 include 中。

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

Error using mex Creating library hostsample.lib and object hostsample.exp hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOInit(struct ASIODriverInfo *)" (?ASIOInit@@YAJPEAUASIODriverInfo@@@Z) referenced in function mexFunction hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOExit(void)" (?ASIOExit@@YAJXZ) referenced in function mexFunction hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOStart(void)" (?ASIOStart@@YAJXZ) referenced in function mexFunction hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOStop(void)" (?ASIOStop@@YAJXZ) referenced in function mexFunction hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOGetChannels(long *,long *)" (?ASIOGetChannels@@YAJPEAJ0@Z) referenced in function " Error using mex Creating library hostsample.lib and object hostsample.exp hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOInit(struct ASIODriverInfo *)" (?ASIOInit@@YAJPEAUASIODriverInfo@@@Z) referenced in function mexFunction hostsample. obj:错误 LNK2019:在 function mexFunction hostsample.obj 中引用的无法解析的外部符号“long __cdecl ASIOExit(void)”(?ASIOExit@@YAJXZ):错误 LNK2019:无法解析的外部符号“long __cdecl ASIOStart(void)”(?ASIOStart@@@ YAJXZ) referenced in function mexFunction hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOStop(void)" (?ASIOStop@@YAJXZ) referenced in function mexFunction hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOGetChannels( function 中引用的 long *,long *)" (?ASIOGetChannels@@YAJPEAJ0@Z)" long __cdecl init_asio_static_data(struct DriverInfo *)" (?init_asio_static_data@@YAJPEAUDriverInfo@@@Z) hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOGetLatencies(long *,long *)" (?ASIOGetLatencies@@YAJPEAJ0@Z) referenced in function "long __cdecl create_asio_buffers(struct DriverInfo *)" (?create_asio_buffers@@YAJPEAUDriverInfo@@@Z) hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOGetBufferSize(long *,long *,long *,long *)" (?ASIOGetBufferSize@@YAJPEAJ000@Z) referenced in function "long __cdecl init_asio_static_data(struct DriverInfo *)" (?init_asio_static_data@@YAJPEAUDriverInfo@@@Z) hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOGetSampleRate(double *)" (?ASIOGetSampleRate@@YAJPEAN@Z) referenced in function "long __cdecl init_asio_static_data(struct DriverInfo *)" (?init_asio_static_data@@YAJPEAUDriverInfo@@@Z) hostsampl long __cdecl init_asio_static_data(struct DriverInfo *)" (?init_asio_static_data@@YAJPEAUDriverInfo@@@Z) hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOGetLatencies(long *,long *)" (?ASIOGetLatencies@@YAJPEAJ0@Z ) function "long __cdecl create_asio_buffers(struct DriverInfo *)" (?create_asio_buffers@@YAJPEAUDriverInfo@@@Z) hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOGetBufferSize(long *,long *,long *,long *)" (?ASIOGetBufferSize@@YAJPEAJ000@Z) 在 function "long __cdecl init_asio_static_data(struct DriverInfo *)" (?init_asio_static_data@@YAJPEAUDriverInfo@@@Z) 中引用(double *)" (?ASIOGetSampleRate@@YAJPEAN@Z) 在 function 中引用 "long __cdecl init_asio_static_data(struct DriverInfo *)" (?init_asio_static_data@@YAJPEAUDriverInfo@@@Z) e.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOSetSampleRate(double)" (?ASIOSetSampleRate@@YAJN@Z) referenced in function "long __cdecl init_asio_static_data(struct DriverInfo *)" (?init_asio_static_data@@YAJPEAUDriverInfo@@@Z) hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOGetSamplePosition(struct ASIOSamples *,struct ASIOTimeStamp *)" (?ASIOGetSamplePosition@@YAJPEAUASIOSamples@@PEAUASIOTimeStamp@@@Z) referenced in function "void __cdecl bufferSwitch(long,long)" (?bufferSwitch@@YAXJJ@Z) hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOGetChannelInfo(struct ASIOChannelInfo *)" (?ASIOGetChannelInfo@@YAJPEAUASIOChannelInfo@@@Z) referenced in function "long __cdecl create_asio_buffers(struct DriverInfo *)" (?create_asio_buffers@@YAJPEAUDriverInfo@@@Z) hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOCreateBuff e.obj:错误 LNK2019:在 function“long __cdecl init_asio_static_data(struct DriverInfo *)”中引用的未解析外部符号“long __cdecl ASIOSetSampleRate(double)”(?ASIOSetSampleRate@@YAJN@Z) (?init_asio_J@@AUDriver@@YA) ) hostsample.obj: 错误 LNK2019: 未解析的外部符号“long __cdecl ASIOGetSamplePosition(struct ASIOSamples *,struct ASIOTimeStamp *)” (?ASIOGetSamplePosition@@YAJPEAUASIOSamples@@PEAUASIOTimeStamp@@@Z) 在 ZC1C425268E68385D1AB5074__C17A94F14Z 缓冲区中引用)" (?bufferSwitch@@YAXJJ@Z) hostsample.obj: 错误 LNK2019: 无法解析的外部符号 "long __cdecl ASIOGetChannelInfo(struct ASIOChannelInfo *)" (?ASIOGetChannelInfo@@YAJPEAUASIOChannelInfo@@@Z) 引用在 function "long __cdecl create_asio struct DriverInfo *)" (?create_asio_buffers@@YAJPEAUDriverInfo@@@Z) hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOCreateBuff ers(struct ASIOBufferInfo *,long,long,struct ASIOCallbacks *)" (?ASIOCreateBuffers@@YAJPEAUASIOBufferInfo@@JJPEAUASIOCallbacks@@@Z) referenced in function "long __cdecl create_asio_buffers(struct DriverInfo *)" (?create_asio_buffers@@YAJPEAUDriverInfo@@@Z) hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIODisposeBuffers(void)" (?ASIODisposeBuffers@@YAJXZ) referenced in function mexFunction hostsample.obj: error LNK2019: unresolved external symbol "long __cdecl ASIOOutputReady(void)" (?ASIOOutputReady@@YAJXZ) referenced in function "struct ASIOTime * __cdecl bufferSwitchTimeInfo(struct ASIOTime *,long,long,class std::vector ers(struct ASIOBufferInfo *,long,long,struct ASIOCallbacks *)" (?ASIOCreateBuffers@@YAJPEAUASIOBufferInfo@@JJPEAUASIOCallbacks@@@Z) 在 function "long __cdecl create_asio_buffers(struct DriverInfo *)" (?create_asio_buffers@@YAJPE @Z) hostsample.obj:错误 LNK2019:未解析的外部符号“long __cdecl ASIODisposeBuffers(void)”(?ASIODisposeBuffers@@YAJXZ) 在 function mexFunction hostsample.obj 中引用:错误 LNK2019:未解析的外部符号“long __cdecl ASIOOutputReady” (?ASIOOutputReady@@YAJXZ) 在 function "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: error LNK2019: unresolved external symbol __imp_timeGetTime referenced in function "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: error LNK2019: unresolved external symbol "public: void __cdecl AsioDrivers::removeCurrentDriver(void)" (?removeCurrentDriver@AsioDrivers@@QEAAXXZ) referenced in function mexFunction hostsample.obj: error LNK2019: unresolved external symbol "bool __cdecl loadAsioDriver(char *) ,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: 在 function "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:未解决function mexFunction hostsample.obj 中引用的外部符号“public:void __cdecl AsioDrivers::removeCurrentDriver(void)”(?removeCurrentDriver@AsioDrivers@@QEAAXXZ):错误 LNK2019:未解析的外部符号“bool __cdecl loadAsioDriver(char *) " (?loadAsioDriver@@YA_NPEAD@Z) referenced in function mexFunction hostsample.obj: error LNK2019: unresolved external symbol "struct ASIOTime * __cdecl bufferSwitchTimeInfo(struct ASIOTime *,long,long)" (?bufferSwitchTimeInfo@@YAPEAUASIOTime@@PEAU1@JJ@Z) referenced in function "void __cdecl bufferSwitch(long,long)" (?bufferSwitch@@YAXJJ@Z) hostsample.obj: error LNK2019: unresolved external symbol "class AsioDrivers * asioDrivers" (?asioDrivers@@3PEAVAsioDrivers@@EA) referenced in function mexFunction hostsample.mexw64: fatal error LNK1120: 19 unresolved externals " (?loadAsioDriver@@YA_NPEAD@Z) 在 function mexFunction hostsample.obj 中引用:错误 LNK2019:未解析的外部符号 "struct ASIOTime * __cdecl bufferSwitchTimeInfo(struct ASIOTime *,long,long)" (?bufferSwitchTimeInfo@@YAPEAUASIOTime@@PEAU1@ JJ@Z) 在 function "void __cdecl bufferSwitch(long,long)" (?bufferSwitch@@YAXJJ@Z) hostsample.obj 中引用:错误 LNK2019:未解析的外部符号 "class AsioDrivers * asioDrivers" (?asioDrivers@@3PEAVAsioDrivers@@ EA)在 function mexFunction hostsample.mexw64 中引用:致命错误 LNK1120:19 个未解决的外部

OK looks like I haven't included all the cpp and h files in the solution.好的,看起来我没有在解决方案中包含所有 cpp 和 h 文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM