error: request for member ‘doc’ in Property

Dear comrades,

I am starting a component and i am trying to create a property, but when i add a .doc to the property i get the following error:

[100%] Building CXX object CMakeFiles/orocomp.dir/orocomp-component.cpp.o
/home/users/josep.a.claret/ros-orocos_pkgs/ros/orocomp/orocomp-component.cpp: In constructor ‘Orocomp::Orocomp(const std::string&)’:
/home/users/josep.a.claret/ros-orocos_pkgs/ros/orocomp/orocomp-component.cpp:9: error: request for member ‘doc’ in ‘((Orocomp*)this)->Orocomp::<anonymous>.RTT::TaskContext::addProperty(((RTT::base::PropertyBase&)(&((Orocomp*)this)->Orocomp::prop1.RTT::Property<unsigned int>::<anonymous>)))’, which is of non-class type ‘bool’
make[2]: *** [CMakeFiles/orocomp.dir/orocomp-component.cpp.o] Error 1
make[1]: *** [CMakeFiles/orocomp.dir/all] Error 2
make: *** [all] Error 2

The code that reports this error is:

orocomp-component.hpp
----------------------------------------------------------------------
#ifndef OROCOS_OROCOMP_COMPONENT_HPP
#define OROCOS_OROCOMP_COMPONENT_HPP

#include <rtt/RTT.hpp>
#include <rtt/Property.hpp>

class Orocomp
: public RTT::TaskContext
{
public:
Orocomp(string const& name);
private:
RTT::Property<unsigned int> prop1;
};
#endif
---------------------------------------------------------------------

and

orocomp-component.cpp

----------------------------------------------------------------------
#include "orocomp-component.hpp"
#include <rtt/Component.hpp>
#include <rtt/Property.hpp>

Orocomp::Orocomp(string const& name)
: TaskContext(name,PreOperational),
prop1("prop1","prop1",666)
{
this->addProperty(prop1).doc("prop1");
}
ORO_CREATE_COMPONENT(Orocomp)
--------------------------------------------------------------------------

I am very new in Orocos, so I am pretty lost. Anyone knows what this error might be?

Any help will be appreciated and thx in advance.

Josep

error: request for member ‘doc’ in Property

Hi all, I already figured out. I made a mess between orocos 1.0 and 2.0, but now works ok!

Josep

From: jsprnclrtrbrt [..] ...
To: orocos-users [..] ...
Date: Fri, 20 May 2011 17:31:41 +0200
Subject: [Orocos-users] error: request for member ‘doc’ in Property

Dear comrades,

I am starting a component and i am trying to create a property, but when i add a .doc to the property i get the following error:

[100%] Building CXX object CMakeFiles/orocomp.dir/orocomp-component.cpp.o
/home/users/josep.a.claret/ros-orocos_pkgs/ros/orocomp/orocomp-component.cpp: In constructor ‘Orocomp::Orocomp(const std::string&)’:
/home/users/josep.a.claret/ros-orocos_pkgs/ros/orocomp/orocomp-component.cpp:9: error: request for member ‘doc’ in ‘((Orocomp*)this)->Orocomp::<anonymous>.RTT::TaskContext::addProperty(((RTT::base::PropertyBase&)(&((Orocomp*)this)->Orocomp::prop1.RTT::Property<unsigned int>::<anonymous>)))’, which is of non-class type ‘bool’
make[2]: *** [CMakeFiles/orocomp.dir/orocomp-component.cpp.o] Error 1
make[1]: *** [CMakeFiles/orocomp.dir/all] Error 2
make: *** [all] Error 2

The code that reports this error is:

orocomp-component.hpp
----------------------------------------------------------------------
#ifndef OROCOS_OROCOMP_COMPONENT_HPP
#define OROCOS_OROCOMP_COMPONENT_HPP

#include <rtt/RTT.hpp>
#include <rtt/Property.hpp>

class Orocomp
: public RTT::TaskContext
{
public:
Orocomp(string const& name);
private:
RTT::Property<unsigned int> prop1;
};
#endif
---------------------------------------------------------------------

and

orocomp-component.cpp

----------------------------------------------------------------------
#include "orocomp-component.hpp"
#include <rtt/Component.hpp>
#include <rtt/Property.hpp>

Orocomp::Orocomp(string const& name)
: TaskContext(name,PreOperational),
prop1("prop1","prop1",666)
{
this->addProperty(prop1).doc("prop1");
}
ORO_CREATE_COMPONENT(Orocomp)
--------------------------------------------------------------------------

I am very new in Orocos, so I am pretty lost. Anyone knows what this error might be?

Any help will be appreciated and thx in advance.

Josep