centos 7.9, gcc: 4.8.5
在2021年7月3日星期六 UTC+8 下午5:43:33<kusamba> 写道:
> when i compile my code(maybe old code) using version 3.17.3
> some strange error occurred
>
> do someone has suggestions?
>
> proto file: common.proto
> *syntax = "proto3";*
> *package uc_netmsg;*
>
> *message CSayHelloRspPara {*
> * int64 m_RspTime = 1;*
> *}*
>
>
> #include "common.pb.h"
> uc_netmsg::CSayHelloRspPara stParam;
> stParam.set_m_rsptime(0x12345678);
>
>
> compile error:
> *g++ -g -Wall -rdynamic -D_DEBUG_ -D_FILE_OFFSET_BITS=64 -I
> ./protobuf/include -std=c++11 -fPIC -c Msg/GameSvrMsg.cpp*
> *In file included from /usr/include/c++/4.8.2/bits/stl_algo.h:66:0,*
> * from /usr/include/c++/4.8.2/algorithm:62,*
> * from
> ./protobuf/include/google/protobuf/stubs/common.h:38,*
> * from
> ./protobuf/include/google/protobuf/io/coded_stream.h:149,*
> * from /home/my/common.pb.h:23,*
> * from Msg/GameSvrMsg.cpp:104:*
> */usr/include/c++/4.8.2/functional:475:12: error: expected ‘)’ before ‘&’
> token*
> * ref(_Tp& __t) noexcept*
> * ^*
> */usr/include/c++/4.8.2/functional:485:14: error: expected unqualified-id
> before ‘const’*
> * void ref(const _Tp&&) = delete;*
> * ^*
> */usr/include/c++/4.8.2/functional:485:14: error: expected ‘)’ before
> ‘const’*
> */usr/include/c++/4.8.2/functional:493:32: error: invalid declarator
> before ‘__t’*
> * ref(reference_wrapper<_Tp> __t) noexcept*
> * ^*
> */usr/include/c++/4.8.2/functional:493:32: error: expected ‘)’ before
> ‘__t’*
> *make: *** [Msg/GameSvrMsg.o] Error 1*
> stParam.SerializeToArray(pcTemp, shMsgParaLength);
>
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/protobuf/a3b1a358-2475-4390-b883-183a938c8b34n%40googlegroups.com.