2

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.

nacho4d
  • 43,720
  • 45
  • 157
  • 240

2 Answers2

3

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.

Aleksandar Totic
  • 2,557
  • 25
  • 27
  • Thanks for your reply, but is not working. Could you tell exactly what your input was in "Header Search Paths" and "Library Search Paths"? I copied the content of pretty_print.cpp into main.cpp of a cpp Xcode project. And, when trying recursive /opt/local/include I get 2 errors, when not recursive I get hundreds!. Also tried tried not recursive opt/local/include and not recursive opt/local/include/openvrml and got only one error in vrml97_grammar.h. I've notice that openvrml file structure is: opt/local/include/openvrml/openvrml/a_lot_of_headers.h, is this strange? – nacho4d Feb 14 '10 at 06:22
  • Or Maybe is there another setting in Xcode I might be skipping? – nacho4d Feb 14 '10 at 06:27
  • My header search path is just '/opt/local/include', non-recursive. If you have boost headers installed, searching /opt/local/include recursively will blow up with the _pow_helper error. This is because your std c++ headers will come from /opt/local/include/boost/compatibility/cpp_c_headers, and cstdio does not have vsnprintf installed. – Aleksandar Totic Feb 15 '10 at 04:41
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.

pqnet
  • 6,070
  • 1
  • 30
  • 51