嘿,我刚刚下载openvrml从MacPorts的 (端口安装openvrml) 现在我有一个示例程序(从SourceForge上的openvrml pretty_print.cpp)是这样开始的:OpenVRML在雪豹(从MacPorts的)
# ifdef HAVE_CONFIG_H
# include <config.h>
# endif
# include <openvrml/vrml97_grammar.h>
# include <openvrml/browser.h>
# include <fstream>
...
然后在Xcode中,我增加了以下路径,并检查“递归”为标题搜索路径和库搜索路径:
/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示例?
在此先感谢。
感谢您的回复,但无法正常工作。你能准确地确定你的输入是在“标题搜索路径”和“库搜索路径”中吗? 我将pretty_print.cpp的内容复制到cpp Xcode项目的main.cpp中。 而且,当尝试递归/ opt/local/include时,我得到2个错误,当不递归时,我得到了数百个! 也尝试尝试不递归选择/本地/包括和不递归选择/本地/包括/ openvrml和vrml97_grammar.h只有一个错误。 我已经通知,openvrml文件结构: 选择/本地/包括/ openvrml/openvrml/a_lot_of_headers.h,这是很奇怪吗? – nacho4d
或者也许在Xcode中可能会跳过另一个设置? – nacho4d
我的标题搜索路径只是'/ opt/local/include',非递归。 如果你已经安装了boost头文件,递归搜索/ opt/local/include将会出现_pow_helper错误。这是因为你的std C++头文件将来自/ opt/local/include/boost/compatibility/cpp_c_headers,并且cstdio没有安装vsnprintf。 –