Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
This error say something about line ending. My project won't compile again.

What I have tried:

I have google tirelessly and I still am.
Posted
Comments
0x01AA 30-Mar-24 7:54am    
Gbenbam 30-Mar-24 8:24am    
I have seen that page already. How does it solve the problem.
Graeme_Grant 30-Mar-24 8:39am    
the answer is there. One of your files is in the incorrect format or corrupted.
Gbenbam 30-Mar-24 8:56am    
Yes,Iknow.How do I correct that?
0x01AA 30-Mar-24 8:40am    
Use e.g. notepad++, load the file and save it again. Make sure notepad++ will use \r\n.
Or: turn the error 'c4335' to warning (not a good choice)

I did a quick Google Search: vs c4335 - Google Search[^]

0x01AA links to Compiler Warning C4335 | Microsoft Learn[^] which is in the Google Search. Here is what it says:
Quote:
Mac file format detected: please convert the source file to either DOS or UNIX format

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').

This warning is always issued as an error. See warning pragma for information about how to disable this warning. Also, this warning is only issued once per compiland. Therefore, if there are multiple #include directives that specify files in Macintosh format, C4335 will only be issued once.

One way to generate files in Macintosh format is by using the Advanced Save Options (on the File menu) in Visual Studio.

Also found this: https://stackoverflow.com/questions/13742840/how-could-i-remove-error-c4335-mac-file-format-detected-in-vc-2008[^] which is the same as the compiler warning that you are seeing and offers solutions to fix.

If this does not help, look at the other search results.
 
Share this answer
 
Comments
0x01AA 30-Mar-24 8:47am    
+5. And I missed the last sentence 'One way to generate files in Macintosh format is by using the Advanced Save Options (on the File menu) in Visual Studio' :-)
Graeme_Grant 30-Mar-24 8:52am    
Thanks ... Sometimes rubber ducking[^] helps! 😉
0x01AA 30-Mar-24 10:48am    
:-)
Gbenbam 30-Mar-24 9:00am    
Icould not find advace save option on visual studio 222
Member 12995087 30-Mar-24 16:16pm    
I am quite sure your VS version is outdated.
To make what others have said more clear, the "Advanced Save Option" which doesn't appear to be anything in Visual Studio 2022 really is there you just have to know where to find it. It is on the File drop down ...

Use Save-As and when the window opens see the down-arrow in the lower right of it, click on that and down will drop the encodings options ... the list of them from which you make your appropriate choice.

When you don't do that right the first time, try a different one. Most strategies here in Visual Studio, at least for me, involve "repeat until something works"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900