这个库的地址以及说明在附件中
在VS2010中可以成功运行连接并运行,如下代码
#include "F:\Program Files\ta-lib\c\include\ta_libc.h"
int main( void )
{
TA_Real closePrice[400];
TA_Integer outBeg;
TA_Real out[400];
TA_Integer outNbElement;
TA_RetCode retCode;
retCode=TA_KAMA(0,399,&closePrice[0],30,
&outBeg, &outNbElement, &out[0] );
}
但是在matlab 2012a中用mex命令对以上相同内容代码编译却报错
#include "mex.h"
#include "F:\Program Files\ta-lib\c\include\ta_libc.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
TA_Real closePrice[400];
TA_Integer outBeg;
TA_Real out[400];
TA_Integer outNbElement;
TA_RetCode retCode;
retCode=TA_KAMA(0,399,&closePrice[0],30,
&outBeg, &outNbElement, &out[0] );
}
》mex test2.c ta_libc_csr.lib ta_libc_csd.lib ta_libc_cmr.lib ta_libc_cmd.lib ta_libc_cdr.lib ta_libc_cdd.lib
正在创建库 C:\Users\luli\AppData\Local\Temp\mex_MglbgX\templib.x 和对象 C:\Users\luli\AppData\Local\Temp\mex_MglbgX\templib.exp
test2.obj : error LNK2019: 无法解析的外部符号 TA_KAMA,该符号在函数 mexFunction 中被引用
test2.mexw64 : fatal error LNK1120: 1 个无法解析的外部命令
F:\PROGRA~2\MATLAB\R2012A\BIN\MEX.PL: Error: Link of 'test2.mexw64' failed.
请各位高手解答 小弟不胜感激!
2012-12-27 21:16 上传
点击文件名下载附件
150 Bytes, 下载次数: 25
库下载地址