Implicit declaration of function - C99

Misa picture Misa · Jul 15, 2011 · Viewed 50.9k times · Source

I am currently using Xcode 4, and in my .pch file I have this macro: #define localize(s) NSLocalizedString((s), nil).
When I try to use this macro in some .m file, I receive this warning: Implicit declaration of function 'localize' is invalid in C99.

This code compiles without a problem, but how can I fix this so I don't get a warning?

Answer

JPsnowytree picture JPsnowytree · Dec 12, 2012

I had this problem when I did a global replace of NSLog with DLog. I foolishly included the

#define DLog(...) NSLog(...

statements, so I ended up with

#define DLog(...) DLog(...

which caused the warnings, and a linker error.