why there are some errors in the mex.h? [closed]
I opened a c file in Turbo C, the beginning of this c file looks like this:
#include <math.h>
#include开发者_开发知识库 <stdio.h>
#include "mex.h"
#include "matrix.h"
It uses some of the matlab structures and do something in c I checked the directory and am sure that they are right. but when I tried to compile it, some errors here (I just copy some and paste, they look similar):
Error C:\MYFILE~1\TC2.0\MEX.H 1: Illegal character '#' (0x23)
Error C:\MYFILE~1\TC2.0\MEX.H 1: Unexpected end of file in conditional... Error C:\MYFILE~1\TC2.0\MATRIX.H 1: Expression syntax
What's wrong?? Seems to be errors in these files, but I just copy this files into the correct folders... Thank you!!
Turbo C? Seriously? Its like 20 years old.
(It was a classic, and I loved it... I'm not bad mouthing it. Its just no longer applicable.)
mex.h
surely uses aspects now that were not valid in the days of Turbo C.
Either, you need to do some porting work to fix up mex.h
and matrix.h
, or you need to get a modern compiler (several good ones are free).
Check that the date of the file is something like 1990, not 2010!
Check that the file is plain ASCII (no BOM at the beginning).
Check that the last line ends with a line break.
If you opened and saved the file with some editor, it may have been changed to a format incompatible with Turbo C.
There seems to be a stray '#' on line 1 of MEX.H
.
Without seeing the file, it is hard to say what the problem is. It might be that there are blanks before the '#', or a comment - but the line is an otherwise valid #ifdef line. Once upon a long time ago (but possibly when Turbo C was created), C preprocessor directives needed the '#' in column 1.
精彩评论