Aditya Aditya - 1 year ago 104
C++ Question

C++ : File format error

While compiling c++ code using vs 2005, i'm getting following mac file format related error. 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. Defaulting to 0x0502 (Windows Server 2003)

Answer Source

According to the 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’).

So just change line ending for your file. To do that, go File -> Advanced Save Options -> Set line endings to Windows.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download