Running an old game in the latest Xcode 4 creates conflicts with the C function in stdio.h

I have a two year old game code that was completely written in cpp in xcode (not C obj). Now I have to run this game in the latest version of Xcode 4. The game is developing great with Xcode 3.2.5. But when I built the game with Xcode4, it shows the 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 suggest me what is going on here? Thank you in advance. Any suggestions will be very noticeable.

+1
source share
2 answers

When I commented on this line definition in one of the type definition files:

#define dprintf printf

The game code is built successfully. The problem was that printf also defined as dprintf , and Xcode4 stdio.h has a definition for its own dprintf. So he got a conflict while he worked well with the previous version of Xcode 3.2.5.

Thanks to everyone who tried to help me solve this problem.

+1
source

I am not familiar with Xcode, but my approach to this is to tell the compiler (gcc in this case) to output the include tree and look at the stdio.h entries from two separate places there. If you place this tree here, we can get to the end - I think this is done using -verbose and --trace .

0
source

All Articles