mutualmobile / MMProgressHUD

An easy-to-use HUD interface with personality.
MIT License
705 stars 131 forks source link

Can't build into non-arc project? #1

Closed TeacherTool closed 11 years ago

TeacherTool commented 11 years ago

Hi, I've tried to include the source folder into my non-arc project, marking all the files with the -fobjc-arc compiler directive. However, I get lots of parse issues and "ARC restrictions" issues (see example screenshot).

Anything I forgot to include, or what?

thx Udo bildschirmfoto 2013-07-01 um 13 03 57

larsacus commented 11 years ago

Where did you add the -fobjc-arc flag? It looks like you may have added the flag at the project-level and may need to add it at the target level for the source files. These are definitely the same errors you would get as if you had not enabled ARC at all on a source file, so you may need to check to make sure that the flag is being added in the correct place.

TeacherTool commented 11 years ago

I added the flags in the Build Phases section (see screenshot). On the project level, arc is turned off (and must stay turned off because my project does not support arc in general). bildschirmfoto 2013-07-01 um 19 48 09 bildschirmfoto 2013-07-01 um 19 51 04

larsacus commented 11 years ago

You will need to set the -fobjc-arc flag on every target that has included those files. If all three of those targets have MMProgressHUD files added to them, then you'll need to set the flag on those as well.

TeacherTool commented 11 years ago

You're right; I hadn't set the flags in all targets. However, that did not solve the problem. Finally, I found out that my "C language dialect" was set to C99 instead of Compiler Default. Switching to that was the trick!

Thank you for your quick help (and thank you for this great library!)

larsacus commented 11 years ago

I'm not sure why changing from C99 would have fixed it, but if it fixed it, it fixed it.

Happy coding!