acecatkintao

Error: invalid initialization of non-const reference of type ‘const RTT::corba::CConnPolicy*&’


I'm trying build the package orocos-toolchain from source.I have already build the ace and tao package inside ACE_wrapper which i downloaded from this page. But after i enter command" catkin_make_isolated --install -DENABLE_CORBA=ON -DCORBA_IMPLEMENTATION=TAO " I'm getting below error:

[100%] Building CXX object rtt/transports/corba/CMakeFiles/rtt-transport-corba-gnulinux_plugin.dir/CorbaLib.cpp.o
In file included from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaLib.cpp:50:0:
/home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/RTTCorbaConversion.hpp: In static member function ‘static bool RTT::corba::AnyConversion<RTT::ConnPolicy>::update(const CORBA::Any&, RTT::corba::AnyConversion<RTT::ConnPolicy>::StdType&)’:
/home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/RTTCorbaConversion.hpp:313:18: error: invalid initialization of non-const reference of type ‘const RTT::corba::CConnPolicy*&’ from an rvalue of type ‘const RTT::corba::CConnPolicy*’
         if ( any >>= result ) {
                  ^
In file included from /home/dinesh/ws/underlay_isolated/build_isolated/rtt/install/rtt/transports/corba/ServiceC.h:114:0,
                 from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaTypeTransporter.hpp:44,
                 from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaTemplateProtocol.hpp:42,
                 from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaLib.cpp:49:
/home/dinesh/ws/underlay_isolated/build_isolated/rtt/install/rtt/transports/corba/DataFlowC.h:1320:32: note:   initializing argument 2 of ‘CORBA::Boolean operator>>=(const CORBA::Any&, const RTT::corba::CConnPolicy*&)’
 RTT_CORBA_API ::CORBA::Boolean operator>>= (const ::CORBA::Any &, const RTT::corba::CConnPolicy *&);
                                ^
In file included from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/DataFlowI.h:47:0,
                 from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/RemoteChannelElement.hpp:42,
                 from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaTemplateProtocol.hpp:43,
                 from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaLib.cpp:49:
/home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaConversion.hpp: In instantiation of ‘static bool RTT::corba::AnyConversion<std::vector<_Tp, _Alloc> >::update(const CORBA::Any&, RTT::corba::AnyConversion<std::vector<_Tp, _Alloc> >::StdType&) [with T = double; _Alloc = std::allocator<double>; RTT::corba::AnyConversion<std::vector<_Tp, _Alloc> >::StdType = std::vector<double>]’:
/home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaTemplateProtocol.hpp:118:57:   required from ‘bool RTT::corba::CorbaTemplateProtocol<T>::updateFromAny(const CORBA::Any*, RTT::base::DataSourceBase::shared_ptr) const [with T = std::vector<double>; RTT::base::DataSourceBase::shared_ptr = boost::intrusive_ptr<RTT::base::DataSourceBase>]’
/home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaLib.cpp:208:1:   required from here
/home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaConversion.hpp:259:18: error: invalid initialization of non-const reference of type ‘const CORBA::DoubleSeq*&’ from an rvalue of type ‘const CORBA::DoubleSeq*’
         if ( any >>= result ) {
                  ^
In file included from /home/dinesh/ws/underlay_isolated/build_isolated/rtt/install/rtt/transports/corba/ServiceC.h:51:0,
                 from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaTypeTransporter.hpp:44,
                 from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaTemplateProtocol.hpp:42,
                 from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaLib.cpp:49:
/home/dinesh/ACE_wrappers/TAO/tao/AnyTypeCode/DoubleSeqA.h:86:41: note:   initializing argument 2 of ‘CORBA::Boolean operator>>=(const CORBA::Any&, const CORBA::DoubleSeq*&)’
 TAO_AnyTypeCode_Export ::CORBA::Boolean operator>>= (const ::CORBA::Any &, const CORBA::DoubleSeq *&);
                                         ^
In file included from /home/dinesh/ws/underlay_isolated/src/orocos/orocos_toolchain/rtt/rtt/transports/corba/CorbaLib.cpp:42:0:
/home/dinesh/ACE_wrappers/TAO/tao/PortableServer/PortableServer.h: At global scope:
/home/dinesh/ACE_wrappers/TAO/tao/PortableServer/PortableServer.h:34:1: warning: ‘TAO_Requires_POA_Initializer’ defined but not used [-Wunused-variable]
 TAO_Requires_POA_Initializer = TAO_POA_Initializer::init ();
 ^
rtt/transports/corba/CMakeFiles/rtt-transport-corba-gnulinux_plugin.dir/build.make:62: recipe for target 'rtt/transports/corba/CMakeFiles/rtt-transport-corba-gnulinux_plugin.dir/CorbaLib.cpp.o' failed
make[2]: *** [rtt/transports/corba/CMakeFiles/rtt-transport-corba-gnulinux_plugin.dir/CorbaLib.cpp.o] Error 1
CMakeFiles/Makefile2:935: recipe for target 'rtt/transports/corba/CMakeFiles/rtt-transport-corba-gnulinux_plugin.dir/all' failed
make[1]: *** [rtt/transports/corba/CMakeFiles/rtt-transport-corba-gnulinux_plugin.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
<== Failed to process package 'rtt': 
  Command '['/home/dinesh/ws/underlay_isolated/install_isolated/env.sh', 'make', '-j4', '-l4']' returned non-zero exit status 2

Reproduce this error by running:
==> cd /home/dinesh/ws/underlay_isolated/build_isolated/rtt && /home/dinesh/ws/underlay_isolated/install_isolated/env.sh make -j4 -l4

Command failed, exiting.

Solution

  • Try to change CorbaType* result; to const CorbaType* result; on line 259 of rtt/rtt/transports/corba/CorbaConversion.hpp