开发者

What does 'inconsistent line ending' mean in Visual Studio 2010?

What does 'inconsistent line ending' mean 开发者_JAVA技巧in Visual Studio 2010?

I also see this error in a dialog when I'm coding in VS2010. How can I stop this error from showing in the dialog?


Windows, Unix, and older Mac OSs use different line endings. (Newer MacOS uses the Unix convention).

Windows uses CR/LF, Unix uses only LF.

Visual Studio is telling you it found messed up line endings on your file, indicating it was probably edited on different operating systems, and has fixed them all for you to be consistent. If you're getting that message more than once per file, then you have to stop whatever is causing the line endings to get borked in the first place, which is most likely not Visual Studio but some other editor.


Billy and Sean has already described the cause of the problem, however one potential fix is to set up your version control system to enforce the correct line endings for .h and .cpp files. For instance if you're using Subversion then this is a matter of setting the svn:eol-style property to native. You can also do File -> Advanced Save Options to force the EOL style for each file you have problems with.


Microsoft's response from http://connect.microsoft.com/VisualStudio/feedback/details/538108/inconsistent-line-endings-dialogue-in-ide:

What that usually means is that you have lines ending with something other than a carriage return/line feed pair. It often happens when you copy and paste from a web page into the code editor.

Since you're developing in Visual Studio, you'll obviously want to choose "Windows" from the drop down.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜