0

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!!

4

3 回答 3

2

检查文件的日期是否类似于 1990,而不是 2010!

检查文件是否为纯 ASCII(开头没有 BOM)。
检查最后一行是否以换行符结尾。

如果您使用某些编辑器打开并保存了文件,它可能已更改为与 Turbo C 不兼容的格式。

于 2010-09-08T15:35:24.587 回答
2

涡轮增压 C? 严重地?好像是20岁。
(这是一部经典之作,我喜欢它……我的口吻还不错。它不再适用了。)

mex.h现在肯定使用在 Turbo C 时代无效的方面。

要么,你需要做一些移植工作来修复mex.hmatrix.h,要么你需要一个现代编译器(几个好的编译器是免费的)。

于 2010-09-08T13:42:00.473 回答
1

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.

于 2010-09-08T13:40:16.453 回答