XCode 4.2.1 - SFML 2.0 中的 va_list、va_start、va_end 问题
这里有几个问题。首先,包含 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)
我不知道该怎么办。我正在使用 SFML 2.0,并包含其中的 Graphics.hpp 会出现这些错误。有什么想法如何解决这个问题吗?
There are a couple of problems here. First, including cstdarg throws this error:
/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;
Then, including c++locale.h throws this:
/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)
I'm not sure what to do about this. I'm using SFML 2.0, and including Graphics.hpp from it gives these errors. Any ideas how to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(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
I ran into this same problem. I discovered that having both
/usr/local/include/**
and/usr/include/**
in my header search path broke all of the standard template libraries. One of the libraries I was using installed its self in/usr/lib
and/usr/include
, I found that uninstalling this library and reinstalling it to/usr/local/lib
and/usr/local/include
solved the problem.I tried including
stdio.h
as suggested above, but it did not help.The system I am using is Mac OS 10.8 and XCode 4.3
我在一个项目中遇到了这个问题,并通过在开头添加一个额外的包含来修复它,该包含负责加载丢失的元素:
如果您查看该文件,您会看到定义:
I had this problem on a project and fixed it by adding an additional include at the start that takes care of loading in the missing element:
If you look in that file you see the definition:
普通 C 头文件与 C++ 头文件不兼容。尝试包含
cstdarg
而不是stdarg.h
Plain C headers are not compatible with C++ ones. Try including
cstdarg
instead ofstdarg.h