XCode 4.2.1 - SFML 2.0 中的 va_list、va_start、va_end 问题

发布于 2025-01-06 13:28:21 字数 682 浏览 0 评论 0原文

这里有几个问题。首先,包含 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

深海不蓝 2025-01-13 13:28:21

我遇到了同样的问题。我发现头搜索路径中同时包含 /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

逆光下的微笑 2025-01-13 13:28:21

我在一个项目中遇到了这个问题,并通过在开头添加一个额外的包含来修复它,该包含负责加载丢失的元素:

#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

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:

#include <stdio.h>

If you look in that file you see the definition:

#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
尝蛊 2025-01-13 13:28:21

普通 C 头文件与 C++ 头文件不兼容。尝试包含 cstdarg 而不是 stdarg.h

Plain C headers are not compatible with C++ ones. Try including cstdarg instead of stdarg.h

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文