'mwIndex' does not name a type

1 回表示 (過去 30 日間)
Zili Chai
Zili Chai 2017 年 11 月 7 日
回答済み: Steven Lord 2017 年 11 月 7 日
Environment: Matlab R2017a/Windows 10/MinGW64 Compiler (C++)
When I run the following codes, I encounter some errors:
# include "math.h"
void CSR_VecMult_CaABC_double(
const int k, const int m, const double alpha,
const double *val, const mwIndex *indx,
const mwIndex *pntrb,
const double *b,
double *c)
{
double t;
const double *pval;
int i,j,jb,je;
pval = val;
for (i=0;i!=m;i++) {
t = 0;
jb = pntrb[i];
je = pntrb[i+1];
for (j=jb;j!=je;j++)
t += alpha * b[indx[j]] * (*pval++);
c[i] += t;
}
}
The warning is as follow:
>>mex -largeArrayDims a_times_b_cmplx.cpp
D:\Ncut_9\a_times_b_cmplx.cpp:52:43: error: 'mwIndex' does not name a type
const double *val, const mwIndex *indx,
^
D:\Ncut_9\a_times_b_cmplx.cpp:53:24: error: 'mwIndex' does not name a type
const mwIndex *pntrb,
Actually I've tried to use another compiler such as Visual C++, but more errors occurred. :-(

回答 (1 件)

Steven Lord
Steven Lord 2017 年 11 月 7 日
Did you include the right header file?

カテゴリ

Help Center および File ExchangeC MEX 文件应用程序 についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!