早稲田大学表現工学科尾形研究室修士1年の佐々木です。 私も以下の環境で同じような症状がでました。 Mac OS X 10.8.5 Xcode 4.6.3 gcc 4.2.1
opertm-aist C++ 1.1.0
/usr/local/include/openrtm-1.1/rtm/Typename.h:133:15: error: no viable overloaded '<<=' any_var <<= tmp_var;
2.0.0-RELESE | Download page |
RT-Component | 153.5 |
RT-Middleware | 35 |
Tools | 22 |
Documentation | 2 |
Motion editor/Dynamics simulator
Dynamics simulator
Integrated Development Platform
RT-Components collection by AIST
Tokyo Opensource Robotics Association
Middleware for DAQ (Data Aquisition) by KEK
OpenRTM-aist mlの皆様:
お世話になります.菅です.
このところ頻繁にアップデートを行ってるMacOSで
RTCが急にビルド出来なくなりました,
もしかしたらXcodeのアップデートが悪かったかもしれません.
iOS6も出たし,アップデートするか,なんて気になったのが悪かったようです.
Macは積極サポート外でしょうが,せめて対症療法だけ共有しましょう.
もし知識をお持ちの方がいらっしゃいましたら,ご意見いただけますか?
■環境
MacOSX Lion10.7.4 + Xcode4.4.1 (llvm-gcc-4.2.1)
OpenRTM-aist C++ 1.1.0 (本日,SVNソースツリーからDLしたもの)を,上記環境でビルドしインストール.
( ./configure --prefix=/usr/)
■症状:
MacOSX Lionでcmakeした後にmakeすると,以下のメッセージが出る.
asura:build ysuga$ make
[ 50%] Building CXX object src/CMakeFiles/myfirstrtc.dir/MyFirstRTC.cpp.o
In file included from
/Users/ysuga/Development/rtm/workspace/MyFirstRTC_cpp_2/src/MyFirstRTC.cpp:10:
In file included from
/Users/ysuga/Development/rtm/workspace/MyFirstRTC_cpp_2/include/MyFirstRTC/MyFirstRTC.h:13:
In file included from /usr/local/include/openrtm-1.1/rtm/Manager.h:33:
/usr/local/include/openrtm-1.1/rtm/Factory.h:94:5: warning: deleting
pointer to incomplete type 'RTC::RTObject_impl' may cause undefined
behaviour [-Wdelete-incomplete]
delete rtc;
^ ~~~
/usr/local/include/openrtm-1.1/rtm/Factory.h:30:9: note: forward
declaration of 'RTC::RTObject_impl'
class RTObject_impl;
^
In file included from
/Users/ysuga/Development/rtm/workspace/MyFirstRTC_cpp_2/src/MyFirstRTC.cpp:10:
In file included from
/Users/ysuga/Development/rtm/workspace/MyFirstRTC_cpp_2/include/MyFirstRTC/MyFirstRTC.h:16:
In file included from /usr/local/include/openrtm-1.1/rtm/DataInPort.h:23:
In file included from /usr/local/include/openrtm-1.1/rtm/InPort.h:32:
/usr/local/include/openrtm-1.1/rtm/Typename.h:126:15: error: no viable
overloaded '<<='
any_var <<= tmp_var;
~~~~~~~ ^ ~~~~~~~
/usr/local/include/openrtm-1.1/rtm/Typename.h:234:52: note: in
instantiation of member function 'CORBA_Util::typecode::id' requested here
return typecode::value, T>::id();
^
/usr/local/include/openrtm-1.1/rtm/OutPort.h:137:27: note: in
instantiation of function template specialization
'CORBA_Util::toRepositoryId' requested here
: OutPortBase(name, ::CORBA_Util::toRepositoryId()),
^
/Users/ysuga/Development/rtm/workspace/MyFirstRTC_cpp_2/src/MyFirstRTC.cpp:38:5:
note: in instantiation of member function
'RTC::OutPort::OutPort' requested here
m_v_outOut("out", m_v_out)
^
/usr/local/include/omniORB4/CORBA_Any.h:80:8: note: candidate function
not viable: no known conversion from 'RTC::TimedLong' to 'cdrStream &'
for 1st argument;
void operator<<= (cdrStream& s);
^
以下,延々とcandidate functionがならぶ
■考察
症状だけ見ると,
Typecode.hの中で,typecodeというクラスを使って,
typecodeの文字列を作ってると思います.
このとき,CORBA::Any型を使って,
テンプレートで渡されたタイプを,StructかObjectか判断し,
structならば,Any型に<<=オペレータで代入し,
Any型のメンバからtypecodeを取り出す,
という作業だったと思います.
この時,typecode::name()関数内で利用している
any_var <<= tmp_var;
の行でエラーが出てますから,
現在TimedDouble型を使っているので,
operator<<=(CORBA::Any& a, const TimedDouble& d)
という関数が見つからないのが原因だと思います.
■対処法(対処療法でっす)
そこで,BasicTypeSkel.hをインクルードするタイミングを変更しました.
□RTCBuilder生成直後
#include
#include
#include
#include
#include
#include
#include
#include
□修正後
#include
#include
#include // これを順序移動
#include // これを順序移動
#include // これを順序移動
#include
#include
#include
これでなぜかビルド出来るようになります.
修正前の順序の時に,BasicDataTypeSkel.hの該当部分が読み込まれないか,
と思ってmessageなどでデバッグしましたが,
どうも読み込まれているっぽいです.
■補足
この症状はLinuxだと出ませんでした.
LinuxはUbuntu 12.04です.同様にソースからビルドしました.
ではでは