OMNeT++ Community Site
  Welcome to OMNeT++ Community Site Wednesday, August 27 2008 

Mailing list archive (omnetpp-l at omnetpp.org)


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omnetpp-l] Defining own message



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!


Not happy with your email address?
Get the one you really want - millions of new email addresses available now at Yahoo!
_______________________________________________
Omnetpp-l mailing list
Omnetpp-l at xxx
http://lists.omnetpp.org/mailman/listinfo/omnetpp-l

Home | Main Index | Thread Index


 Copyright © 2008 OMNeT++ Community Site
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By GeekLog v1.3.7sr1 
Page created in 0.04 seconds