schdvir@gmail.com wrote:[color=blue]
> tdagent.C: In constructor `tdagent::tdagent(simple_env*)':
> tdagent.C:13: error: no matching function for call to `actor::actor()'
> actor.H:28: note: candidates are: actor::actor(const actor&)
> actor.H:38: note: actor::actor(boost::numeric::ublas::vector<float,
> boost::numeric::ublas::unbounded_array<float, std::allocator<float> >[color=green]
> >)[/color][/color]
This means that something is trying to call the default constructor for
actor, but the default constructor doesn't exist. Normally, the
compiler generates one for you -- however, if you create any other
constructors (except copy ctor? Can't recall ATM), it won't do that so
you have to create one yourself.
Unfortunately, you didn't post tdagent.H, so we don't have enough code
here to figure out where you're doing this. Most likely you have an
actor as a data member of tdagent, and since you didn't use an
initializer list (learn about those, they're important), it gets
default-constructed prior to entering the constructor body.
[color=blue]
> tdagent.C
> -------------------
>
> #include "tdagent.H"
>
> tdagent::tdagent(simple_env* environment)
> {[/color]
At this point, any data members (other than primitives) you haven't
initialized via an initializer list will be default-initialized, which
means they need a zero-arg (nullary) ctor.
[color=blue]
> actor1 = new actor(env->get_cov);[/color]
Now, I wonder very much why you'd have an actor as a by-value data
member of tdagent, if you've got other actors by-pointer.
Where's the destructor?
[color=blue]
> actro.H
> -------------
>
> using namespace boost::numeric::ublas;[/color]
Never do this in headers.
Luke