POV-Ray / povray

The Persistence of Vision Raytracer (POV-Ray)
https://www.povray.org/
GNU Affero General Public License v3.0
1.37k stars 282 forks source link

reference to 'shared_ptr' is ambiguous #8

Closed ryandesign closed 10 years ago

ryandesign commented 10 years ago

Building povray 3.7.0.0 on OS X 10.9 has the following trouble:

In file included from backend/bounding/bbox.cpp:43:
In file included from ./backend/frame.h:58:
In file included from ./backend/control/messagefactory.h:39:
./backend/control/renderbackend.h:112:16: error: reference to 'shared_ptr' is ambiguous
  map<SceneId, shared_ptr<Scene> > scenes;
               ^
../vfe/unix/syspovconfig.h:85:14: note: candidate found by name lookup is 'shared_ptr'
using boost::shared_ptr;
             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:3756:56: note: candidate found by name lookup is 'std::__1::shared_ptr'
class __attribute__ ((__type_visibility__("default"))) shared_ptr
                                                       ^

In MacPorts we are replacing all occurrences of shared_ptr with boost::shared_ptr to work around this.

c-lipka commented 10 years ago

Why on earth does your compiler do this, despite the boost type being explicitly pulled in by the "using" directive?

Maybe explicitly telling the compiler to not use C++11 might help.

mistydemeo commented 10 years ago

This is specifically happening using clang's libc++ standard library, which is the default under OS X 10.9. Not sure it can be made to not use C++11.

c-lipka commented 10 years ago

It might be worth trying boost::tr1 for the smart pointers; according to the docs it should simply pull in std::tr1 if available, but boost's implementation otherwise.

c-lipka commented 10 years ago

should be fixed in master now.