OpenVRML in snow-leopard (from macports)

与世无争的帅哥 提交于 2019-12-12 21:18:20

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/1678828/openvrml-in-snow-leopard-from-macports

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!