1

My cocos2d iOS game code compiles and runs without error in Xcode 4.2.1 but Xcode 4.3 beta 2 stops with "No newline at end of file" error. the error is in many coco2d files.

What should I do?

Dan D.
  • 73,243
  • 15
  • 104
  • 123
Abbas Mousavi
  • 486
  • 3
  • 17

2 Answers2

6

You can disable this in the Project Settings > Build Settings, under the "Apple LLVM compiler 3.1 warnings" set "Missing Newline At End Of File" to "No".

MGA
  • 3,711
  • 1
  • 21
  • 22
2

How about adding in a new line at the end of those files? :-)

It shouldn't be an error but a warning. Do you have a compiler setting set to not compile on any warnings?

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • 1
    Adding a new line to each file will solve the problem but I can not add a newline to each file in each library I use. It is not a good practice. I don't have any special compiler setting, I have installed Xcode 4.3 newly on a new machine. – Abbas Mousavi Dec 25 '11 at 14:18
  • [Here's a related question with alternative opinions](http://stackoverflow.com/questions/282851/what-flag-silences-gccs-warning-about-no-new-line-at-file-endings), but yes, these "errors" really should be warnings. Is your build aborting because of the warnings or is there some other error? – Michael Dautermann Dec 25 '11 at 14:23
  • I use LLVM not GCC. I think that apple has changed some default configurations for the compiler, since my code compiles without errors in Xcode 4.2.1. and about your second questions, they are errors not warnings and the build fails after them. – Abbas Mousavi Dec 25 '11 at 14:56
  • They may have changed some default configurations, but as best as I can tell, even when using clang it should still be considered a warning. Let's see if other people have good suggestions, too. I'll edit your question to add some additional attractive & sexy tags. – Michael Dautermann Dec 25 '11 at 15:17