RangeNetworks / openbts

GSM+GPRS Radio Access Network Node
GNU Affero General Public License v3.0
864 stars 326 forks source link

no match for ‘operator<<’ #32

Open tom-2015 opened 6 years ago

tom-2015 commented 6 years ago

I get a lot of these errors with the Log(level) function/class when I try to compile on a Raspberry Pi Debian Stretch:

`L3StateMachine.cpp: In member function ‘void Control::MachineBase::machineErrorMessage(int, int, const GSM::L3Message, const SIP::DialogMessage, const char*)’: L3StateMachine.cpp:88:20: error: no match for ‘operator<<’ (operand types are ‘std::ostringstream {aka std::__cxx11::basic_ostringstream}’ and ‘std::ostringstream {aka std: Log(level).get() <<os <<" Unexpected L3 message:"<<l3msg;


In file included from /usr/include/c++/6/istream:39:0,
                 from /usr/include/c++/6/sstream:38,
                 from ../CommonLibs/Logger.h:41,
                 from L3StateMachine.h:31,
                 from L3StateMachine.cpp:19:
/usr/include/c++/6/ostream:628:5: note: candidate: std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Tstringstream<char>] <near match>
     operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x)
     ^~~~~~~~
`
g++ (Raspbian 6.3.0-18+rpi1) 6.3.0 20170516
Does anyone know a reason/solution?
figbux commented 6 years ago

Got the same error on Arch Linux (4.9.65-1-lts)

tom-2015 commented 6 years ago

I've solved this using older gcc / g++ files. Here is how to do it: https://www.raspberrypi.org/forums/viewtopic.php?f=41&t=196658