gpt4 book ai didi

xcode - 在最新的 Xcode 4 中运行旧游戏版本会与 stdio.h 中的 C 函数产生冲突

转载 作者:行者123 更新时间:2023-12-01 06:44:44 26 4
gpt4 key购买 nike

我有一个两年前的游戏代码,它完全用 xcode 中的 cpp 编写(不是 obj C)。现在我必须在最新版本的 Xcode 4 中运行这个游戏。这个游戏在 Xcode 3.2.5 上构建得很好。但是当我用 Xcode4 构建游戏时,它显示以下错误。
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.hThe red mark appear in line number 446 in stdio.h
谁能建议我这里发生了什么?提前致谢。任何建议都将是非常可观的。

最佳答案

我不明白你的代码是用 C++ 编写的(你在问题中提到了 cpp)还是用 C 编写的(这表明你的问题的标签)。

反正官方原型(prototype)printf()不包括 int作为第一个参数,所以 Xcode4 有正当理由提示。

关于xcode - 在最新的 Xcode 4 中运行旧游戏版本会与 stdio.h 中的 C 函数产生冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6861383/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com