雪豹中的 OpenVRML(来自 macports)

发布于 2024-08-10 17:53:06 字数 947 浏览 6 评论 0原文

嘿,我刚刚从 macports 下载了 openvrml (端口安装openvrml) 现在我有一个示例程序(来自sourceforge的openvrml的pretty_print.cpp),其开头如下:

# ifdef HAVE_CONFIG_H
#   include <config.h>
# endif

# include <openvrml/vrml97_grammar.h>
# include <openvrml/browser.h>
# include <fstream>
...

然后在Xcode中,我添加了以下路径并检查“recursive”标题搜索路径和Lib搜索路径:

/opt/local/var/macports/software

并且所有'*** .h 文件未找到'错误消失了,但现在我有以下两个错误:

complex.h 943 '__pow_helper' is not a member of std
c++locale.h 71 'vsnprintf' is not a member of std

/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/complex: In function 'std::complex<_Tp> std::pow(const std::complex<_Tp>&, int)':
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/complex:943: error: '__pow_helper' is not a member of 'std'

两个错误都来自系统文件。 我想知道是什么导致了这个错误...... 谁能建议我如何在 Mac 上使用 openvrml 示例?

提前致谢。

Hey, I just Downloaded openvrml from macports
(port install openvrml)
Now I have a Sample program (pretty_print.cpp from openvrml at sourceforge) that begins like this:

# ifdef HAVE_CONFIG_H
#   include <config.h>
# endif

# include <openvrml/vrml97_grammar.h>
# include <openvrml/browser.h>
# include <fstream>
...

then in Xcode, I added the following path and check "recursive" for the Header search path and Lib Search Path:

/opt/local/var/macports/software

And all '***.h file not found' errors disappeared, but now I have the following two:

complex.h 943 '__pow_helper' is not a member of std
c++locale.h 71 'vsnprintf' is not a member of std

/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/complex: In function 'std::complex<_Tp> std::pow(const std::complex<_Tp>&, int)':
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/complex:943: error: '__pow_helper' is not a member of 'std'

both errors come from system files.
I wonder what is causing this errors...
Can anyone advice me on how to use openvrml samples on Macs?

thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

讽刺将军 2024-08-17 17:53:06

我也遇到过类似的问题。我为“/opt/local/include”路径定义了“递归”标志。这从 boost 兼容性包含中引入了一些奇怪的 c++ 头文件。

一般来说,您不希望包含路径上有“递归”标志。

尝试从路径中取消选中“递归”。

I've had a similar problem. I defined "recursive" flag for an '/opt/local/include' path. This pulled in some strange c++ headers from boost compatiblity includes.

In general, you do not want "recursive" flag on your include paths.

Try unchecking "recursive" from your paths.

萌逼全场 2024-08-17 17:53:06

如果你将递归放在包含 boost 头文件的路径上,你将使用一些随机的 boost 头文件,这些头文件可能设计用于不同的环境和/或不同的编译器,而不是标准的 C++ 头文件,这意味着,例如,你将包括TR1 标头而不是标准标头。这可能是导致您出现问题的原因(我也遇到过这种情况)。
只需找到包含所需标头的目录,然后仅将其放入标头搜索路径中,而不是偷懒并使用“递归”标志,因为有很多标头文件具有相同的名称但仅位置不同。

if you put recursive on a path containing boost headers you'll use some random boost headers, which are likely designed to be used in different environment and/or different compiler, instead of standard C++ headers, meaning, for example, you'll include TR1 header instead of standard header. This is likely to be the cause of your problem (it happened to me too).
Just locate the directory which contains the headers you need and put only that in header search path instead of being lazy and using "recursive" flag, since there are a lot of header files which have same name but differ in location only.

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