I got lots of trouble to call c function from matlab.
My c function is simple
test.c
#include "mex.h"
int addOne(int a)
{
return a+1;
}
I typed mex test.c in matlab command window, I got this error message
Undefined symbols for architecture x86_64:
"_mexFunction", referenced from:
-exported_symbol[s_list] command line option
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
mex: link of ' "test.mexmaci64"' failed.
My Matlab is 2013a, osx 10.9, xcode 5.02
Does anybody have an idea about this? Thanks.