Xcode4 XCode 4.2.1-SFML 2.0中的va_列表、va_开始、va_结束存在问题

Xcode4 XCode 4.2.1-SFML 2.0中的va_列表、va_开始、va_结束存在问题,xcode4,variadic-functions,Xcode4,Variadic Functions,这里有几个问题。首先,包括cstdarg会引发此错误: /usr/include/c++/4.2.1/cstdarg:59:11:{60:9-60:11}: error: no member named 'va_list' in the global namespace [3] using ::va_list; 然后,包括c++locale.h会抛出以下内容: /usr/include/c++/4.2.1/bits/c++locale.h:76:5: error: use of unde

这里有几个问题。首先,包括cstdarg会引发此错误:

/usr/include/c++/4.2.1/cstdarg:59:11:{60:9-60:11}: error: no member named 'va_list' in the global namespace [3]
   using ::va_list;
然后,包括c++locale.h会抛出以下内容:

/usr/include/c++/4.2.1/bits/c++locale.h:76:5: error: use of undeclared identifier 'va_start' [3]
     va_start(__args, __fmt);
     ^
/usr/include/c++/4.2.1/bits/c++locale.h:84:5: error: use of undeclared identifier 'va_end' [3]
     va_end(__args);
     ^
/usr/include/c++/4.2.1/cstdarg:54:20: note: instantiated from:
 #define va_end(ap) va_end (ap)

我不知道该怎么办。我使用的是SFML2.0,其中的Graphics.hpp会给出这些错误。有什么办法来解决这个问题吗?< /P> < P>纯C标题与C++的头不兼容。尝试使用CSTARDG代替STARDG。H/P>< P>普通C标题与C++的不兼容。尝试包含cstdarg而不是stdarg.h

我在一个项目中遇到了这个问题,并通过在开始时添加一个额外的include来修复它,该include负责加载缺少的元素:

#include <stdio.h>
如果查看该文件,您将看到以下定义:

#ifndef _VA_LIST
#define _VA_LIST
/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
 * __gnuc_va_list and include <stdarg.h> */
typedef __darwin_va_list    va_list;
#endif

我在一个项目中遇到了这个问题,并通过在开始时添加一个额外的include来修复它,该include负责加载缺少的元素:

#include <stdio.h>
如果查看该文件,您将看到以下定义:

#ifndef _VA_LIST
#define _VA_LIST
/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
 * __gnuc_va_list and include <stdarg.h> */
typedef __darwin_va_list    va_list;
#endif

我遇到了同样的问题。我发现在标题搜索路径中同时使用/usr/local/include/**和/usr/include/**会破坏所有标准模板库。我使用的一个库在/usr/lib和/usr/include中安装了它自己,我发现卸载这个库并将它重新安装到/usr/local/lib和/usr/local/include解决了这个问题

我尝试按照上面的建议加入stdio.h,但没有效果


我使用的系统是Mac OS 10.8和XCode 4.3,我遇到了同样的问题。我发现在标题搜索路径中同时使用/usr/local/include/**和/usr/include/**会破坏所有标准模板库。我使用的一个库在/usr/lib和/usr/include中安装了它自己,我发现卸载这个库并将它重新安装到/usr/local/lib和/usr/local/include解决了这个问题

我尝试按照上面的建议加入stdio.h,但没有效果


我使用的系统是Mac OS 10.8和XCode 4.3,谢谢,但它会产生同样的错误。如果包含stdarg.hNo,XCode似乎会自动调用cstdarg。首先,做这件事的不是Xcode,而是C预处理器。第二,它将包含你所要求的任何内容。我明白了,有趣的是,它发生在Hanks上,产生了同样的错误。如果包含stdarg.hNo,XCode似乎会自动调用cstdarg。首先,做这件事的不是Xcode,而是C预处理器。第二,它将包括你所要求的任何东西。我明白了,很有趣,它正在发生