Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
Curious
Posts:
1,699
Registered:
12/6/04
|
|
Re: c program fails to compile with mex, while cpp program compiles fine
Posted:
Feb 1, 2013 1:24 PM
|
|
"shome" wrote in message <keg4a0$r58$1@newscl01ah.mathworks.com>... > Hi, > I get the following error while compiling hello.c > > >> mex hello.c > /usr/local/MATLAB/R2012a/bin/mex: 1: eval: -c: not found > > mex: compile of ' "hello.c"' failed. > > Error using mex (line 206) > Unable to complete successfully. > > Hello.c: > > #include <math.h> > #include <matrix.h> > #include <mex.h> > > void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) > { > mexPrintf("Hello World!\n"); > } > > if i rename hello.c to hello.cpp it compiles properly. > > I guess matlab missing the c compiler.How do i fix the above problem.
I may be completely off base here, but my understanding is that MATLAB doesn't "come" with a c compiler. It uses the c compiler you have (already) installed on your computer (with the "mex -setup" command).
|
|
|
|