Boost logo

Boost Users :

Subject: Re: [Boost-users] shared_ptr and Visual Studio 2008 Express SP1
From: John Maddock (john_at_[hidden])
Date: 2008-11-05 11:37:00


Igor R wrote:
>>> For example in .cpp files I using several usings such as:
>>>
>>> using namespace std;
>>> using namespace std::tr1;
>>> using namespace boost;
>>>
>>> In source code I have something like this:
>>>
>>> shared_ptr<SomeType> var = /*...*/;
>>>
>>> And for each such line I have an error:
>>> error C2872: 'shared_ptr' : ambiguous symbol

Nothing unusual about that: you have two different shared_ptr's visible in
scope: boost::shared_ptr and std::tr1::shared_ptr. You need to decide which
you intend to use and either prefix all shared_ptr usages with the
appropriate qualifiers, or else just take care to only import the one
shared_ptr in the first place.

HTH, John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net