开发工具包;从 hostsample.cpp 构建 mex 文件时出错
ASIOSDK; Error when building mex file from hostsample.cpp
我正在编写一个 c++ 文件以构建到 mex 中,但是我使用 asio 函数遇到了未解决的外部符号错误,例如 "ASIOExit"。我正在使用 mex 命令在 Matlab 控制台中构建。
我已经从 AsioSDK 中放入了所有头文件和 cpp 文件。放入一个文件夹广告中 -I 包含该文件夹。我还需要包括什么或 link?
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 "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)
hostsample.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 ASIOCreateBuffers(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
,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 *)" (?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
好的,看来我没有在解决方案中包含所有 cpp 和 h 文件。
我正在编写一个 c++ 文件以构建到 mex 中,但是我使用 asio 函数遇到了未解决的外部符号错误,例如 "ASIOExit"。我正在使用 mex 命令在 Matlab 控制台中构建。 我已经从 AsioSDK 中放入了所有头文件和 cpp 文件。放入一个文件夹广告中 -I 包含该文件夹。我还需要包括什么或 link?
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 "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) hostsample.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 ASIOCreateBuffers(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
,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 *)" (?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
好的,看来我没有在解决方案中包含所有 cpp 和 h 文件。