[Lumiera] time::Control Errors

Hendrik Boom hendrik at topoi.pooq.com
Sat Oct 22 17:18:25 CEST 2011


On Sat, Oct 22, 2011 at 04:39:29AM -0500, Michael R Fisher wrote:
> I'm probably just missing some weird c++ nitch, but when I try to
> include lib/time/control.hpp, I get compile errors like crazy.  I'm
> including control.hpp and control-policy.hpp inside of the ibeam
> tool header.  Which files do I need to include and where I guess is
> the question?  I want the time::Control to live inside of the ibeam
> tool itself.
> 
> Please bear with me on the C++ newbie crap. I swear I'll get over
> it.  Not sure what ambiguous is all about.  Do I need to put a using
> namespace xxx; somwhere?
> 
>  Compiling++  src/gui/panels/panel.cpp
>   Compiling++  src/gui/panels/viewer-panel.cpp
> In file included from src/gui/widgets/timeline/timeline-ibeam-tool.hpp:32:0,
>                  from src/gui/widgets/timeline-widget.hpp:36,
>                  from src/gui/panels/timeline-panel.hpp:34,
>                  from src/gui/workspace/workspace-window.hpp:39,
>                  from src/gui/panels/viewer-panel.cpp:28:
> src/lib/time/control-policy.hpp: In static member function 'static
> std::tr1::function<TI(const SRC&)> lib::time::mutation::Policy<TI,
> SRC, typename boost::disable_if<lib::time::mutation::<unnamed>::canMutateDuration<SRC>, lib::time::Duration>::type>::buildChangeHandler(lib::time::Duration&)':
> src/lib/time/control-policy.hpp:337:65: error: call of overloaded
> 'ref(lib::time::Duration&)' is ambiguous
> /usr/include/c++/4.5/tr1/functional:488:5: note: candidates are:
> std::tr1::reference_wrapper<_Tp> std::tr1::ref(_Tp&) [with _Tp =
> lib::time::Duration]
> /usr/include/boost/ref.hpp:64:63: note:                 const
> boost::reference_wrapper<T> boost::ref(T&) [with T =
> lib::time::Duration]
> 
> ... More of the same stuff ...

This reminds me why I avoid C++ :-(.

But let's see if I can recall obscure C++isms from when I was 
implementing C++ about 20 years ago.

You have two definitions of ref hanging around, from two different 
packages.  Actually, looking at the message, they see to be from two 
different templates, both defined in include files from the library.

Perhaps you should include only one of the two include files 
(though probably you need both, or else they're fetched from others you 
really need.)

I've heard that some things formerly in boost have been moved into the 
standard library in the past few years.  Perhaps this is one of these 
features and your system has only been partially updated?  Does your 
code compile with older versions of C++ and/or boost?  If that's the 
case, you may have to downgrade or upgrade, possibly waiting until 
your compatible versions of boost and std:tr1 get into your distro.

Perhaps you need to be explicit about your use of ref, and call it as 
boost::ref(....) or as std::tr1::ref(...) instead.  If this works, at 
least we've got more information about the problem.

-- hendrik


More information about the Lumiera mailing list