Hi, all, i want to define my own application layer message, here is the code:
cplusplus {{
#include <string>
#include "ApplPkt_m.h"
}};
class ApplPkt;
message NewApplPkt extends ApplPkt
{
fields:
string fragment;
};
when i compile it, the compiler keeps giving these errors:
NewApplLayer.cc(134) : error C2664: 'NewApplPkt::setFragment' : cannot convert
arameter 1 from 'std::string' to 'const char *'
No user-defined-conversion operator available that can perform this con
ersion, or the operator cannot be called
NewApplLayer.cc(155) : error C2664:
'NewApplPkt::setFragment' : cannot convert
arameter 1 from 'std::string' to 'const char *'
No user-defined-conversion operator available that can perform this con
ersion, or the operator cannot be called
NewApplLayer.cc(183) : error C2664: 'int std::basic_string<_Elem,_Traits,_Ax>::
ompare(const std::basic_string<_Elem,_Traits,_Ax> &) const' : cannot convert pa
ameter 1 from 'bool' to 'const std::basic_string<_Elem,_Traits,_Ax> &'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
Reason: cannot convert from 'bool' to 'const std::basic_string<_Elem,_T
aits,_Ax>'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
No constructor could take the source type, or constructor overload reso
ution was ambiguous
please help, thanks a lot!