简体   繁体   English

C ++:文件格式错误

[英]C++ : File format error

While compiling c++ code using vs 2005, i'm getting following mac file format related error. 当使用vs 2005编译c ++代码时,我遇到了与mac文件格式有关的错误。 I couldn't find any reference in the internet for this particular error. 对于此特定错误,我在互联网上找不到任何参考。 Can someone help me regarding this. 有人可以帮我吗

error C4335: Mac file format detected: please convert the source file to either DOS or UNIX format WINVER not defined. 错误C4335:检测到Mac文件格式:请将源文件转换为DOS或UNIX格式WINVER(未定义)。 Defaulting to 0x0502 (Windows Server 2003) 默认为0x0502(Windows Server 2003)

According to the MSDN : 根据MSDN

The line termination character of the first line of a source file is Macintosh style ('\\r') as opposed to UNIX ('\\n') or DOS ('\\r\\n'). 源文件第一行的行终止符是Macintosh样式('\\ r'),而不是UNIX('\\ n')或DOS('\\ r \\ n')。

So just change line ending for your file. 因此,只需更改文件的行尾即可。 To do that, go File -> Advanced Save Options -> Set line endings to Windows . 为此,请转到File -> Advanced Save Options -> Set line endings to Windows

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM