I have a two year old game code which was completely written in cpp in xcode (not obj C). Now I have to run this game in latest version of Xcode 4. The game builds great with Xcode 3.2.5. But when i built the game with Xcode4, it shows following error.
GCC 4.2 Error: Declaration of C function 'int printf(int, const char*, ...)' conflicts with in /Developer/Xcode4/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/include/stdio.h
The red mark appear in line number 446 in stdio.h
Can anyone please suggest me what is going on here? Thanks in advance. Any suggestions would be very appreciable.
When I commented this line definition in one of my type definition file:
#define dprintf printfThe game code built successfully. The problem was that the
printfwas also defined asdprintfand Xcode4’s stdio.h has definition for dprintf of its own. So, it got conflict, whereas it worked well with previous version of Xcode 3.2.5.Thanks for everyone who tried to help me out with this issue!!