OMNeT++ Community Site
  Welcome to OMNeT++ Community Site Monday, October 13 2008 

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


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

Re: [omnetpp] Defining own application layer message



Thanks for your help, I have modified my message according to your example, but I still get the following errors:

c:\omnetpp\project\NewApplPkt.msg(1) : error C2470: 'cplusplus' : looks like a f
unction definition, but there is no parameter list; skipping apparent body
c:\omnetpp\project\NewApplPkt.msg(8) : error C2079: 'fragmentList' uses undefine
d class 'noncobject'
c:\omnetpp\project\NewApplPkt.msg(10) : error C2146: syntax error : missing ';'
before identifier 'NewApplPkt'
c:\omnetpp\project\NewApplPkt.msg(10) : error C4430: missing type specifier - in
t assumed. Note: C++ does not support default-int
c:\omnetpp\project\NewApplPkt.msg(10) : error C2146: syntax error : missing ';'
before identifier 'extends'
c:\omnetpp\project\NewApplPkt.msg(10) : error C4430: missing type specifier - in
t assumed. Note: C++ does not support default-int
c:\omnetpp\project\NewApplPkt.msg(11) : error C2146: syntax error : missing ';'
before identifier 'ApplPkt'
c:\omnetpp\project\NewApplPkt.msg(11) : error C4430: missing type specifier - in
t assumed. Note: C++ does not support default-int
c:\omnetpp\project\NewApplPkt.msg(11) : error C2143: syntax error : missing ';'
before '{'
c:\omnetpp\project\NewApplPkt.msg(11) : error C2447: '{' : missing function head
er (old-style formal list?)
c:\omnetpp\project\NewApplLayer.h(13) : error C2065: 'string' : undeclared ident
ifier
c:\omnetpp\project\NewApplLayer.h(14) : error C2955: 'std::list' : use of class
template requires template argument list

I have a list of fragments in my own application layer, I want to broadcast the message including the fragments to other hosts to see if they have the same fragments. Does this keep causing the compiling errors? Please help, thanks!!!


----- Original Message ----
From: Alfonso Ariza <aarizaq_m at xxx>
To: OMNeT++ Discussion List <omnetpp-l at xxx>
Sent: Wednesday, 16 July, 2008 10:41:56 AM
Subject: Re: [omnetpp] Defining own application layer message

You hace a mistake with the string,

cplusplus {{
#include <string>
#include "ApplPkt_m.h"
typedef std::list<std::string> fragmentList;
}};


--------------------------------------------------
From: "Solo Zhang" <solonilia at xxx>
Sent: Wednesday, July 16, 2008 12:56 AM
To: <omnetpp-l at xxx>
Subject: [omnetpp] Defining own application layer message

> Hi, everyone, i would like to define my own application layer message, 
> based on this example: http://www.omnetpp.org/listarchive/msg10700.php, 
> here is the code for my message:
>
> cplusplus {{
> #include "ApplPkt_m.h"
> typedef std::list<string> fragmentList;
> }};
>
> class ApplPkt;
> class noncobject fragmentList;
>
> message NewApplPkt extends ApplPkt
> {
>   fields:
>      fragmentList fragments;
> };
>
> when I compile it, the compiler gives these errors:
> NewApplPkt_m.cc
> c:\omnetpp\project\NewApplPkt_m.h(21) : error C2065: 'string' : undeclared 
> ident
> ifier
> NewApplPkt_m.cc(72) : error C2512: 'std::list' : no appropriate default 
> construc
> tor available
> NewApplPkt_m.cc(76) : error C2512: 'std::list' : no appropriate default 
> construc
> tor available
> NewApplPkt_m.cc(92) : error C2678: binary '=' : no operator found which 
> takes a
> left-hand operand of type 'fragmentList' (or there is no acceptable 
> conversion)
>        C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\list(524): 
> could
> be 'std::list<_Ty,_Ax> &std::list<_Ty,_Ax>::operator =(const 
> std::list<_Ty,_Ax>
> &)'
>        while trying to match the argument list '(fragmentList, const 
> fragmentLi
> st)'
> NewApplPkt_m.cc(92) : error C2582: 'operator =' function is unavailable in 
> 'std:
> :list'
> NewApplPkt_m.cc(115) : error C2678: binary '=' : no operator found which 
> takes a
> left-hand operand of type 'fragmentList' (or there is no acceptable 
> conversion)
>
>        C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\list(524): 
> could
> be 'std::list<_Ty,_Ax> &std::list<_Ty,_Ax>::operator =(const 
> std::list<_Ty,_Ax>
> &)'
>        while trying to match the argument list '(fragmentList, const 
> fragmentLi
> st)'
> NewApplPkt_m.cc(115) : error C2582: 'operator =' function is unavailable 
> in 'std
> ::list'
>
> It looks like there is something wrong with the list field. I am really 
> confused about these, please help. Thanks!!!
>
>
>      __________________________________________________________
> Not happy with your email address?.
> Get the one you really want - millions of new email addresses available 
> now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html
> _______________________________________________
> OMNeT++ Mailing List
> options: http://lists.omnetpp.org/mailman/listinfo/omnetpp-l
> archive: http://www.omnetpp.org/listarchive/index.php
> 
_______________________________________________
OMNeT++ Mailing List
options: http://lists.omnetpp.org/mailman/listinfo/omnetpp-l
archive: http://www.omnetpp.org/listarchive/index.php



      __________________________________________________________
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html
_______________________________________________
OMNeT++ Mailing List
options: http://lists.omnetpp.org/mailman/listinfo/omnetpp-l
archive: http://www.omnetpp.org/listarchive/index.php

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