I have been trying to compile some mex files in matlab. The file was compiling well but it was throwing the following error while i ran it.
Invalid MEX-file 'filename.mexw32': The specified procedure could not be found.
I have narrowed down the cause to a function push_back()
used in the code. The code snippet is as follows.
typedef vector<node> node_list;
node_list q;...
node n;
n.id = 0;
n.parent = -1;
n.is_leaf = 0; // <- set to 1 if node symbol is a terminal
n.rhs_index = 0;
n.symbol = ctx.start_symbol;
n.rule_index = 0; // <- set after computing argmax rule
n.rhs_index = 0;
n.x = start_x;
n.y = start_y;
n.l = start_l;
n.ds = 0;
n.dx = 0; // <- set if def rule
n.dy = 0; // <- set if def rule
n.score = start_score;
n.loss = 0; // <-- set if start symbol
q.push_back(n);
The final line q.push_back(n);
is causing the error.
I have included the header files
mex.h, vector, iostream and list
How can I solve this issue? Should I define the method push_back here in the code? If yes, how should I do it? I am a beginner in c++. Any help would be appreciated.