[ndnSIM] ndnSIM older version compatibility issue
Alex Afanasyev
aa at CS.UCLA.EDU
Fri Apr 15 13:54:55 PDT 2016
What I guess from the error is that somewhere something have `#define ECHO` (I cannot really tell where it is defined). This define messes up source code at the pre-compiler stage and making compiler very confused.
--
Alex
> On Apr 11, 2016, at 1:51 AM, Junaid Ahmed Khan <junaidakhan88 at gmail.com> wrote:
>
> Hi Alex,
>
> I performed some simulations with an eirlier version of ndnsim in 2014. I recently updated ndnSIM (fresh installation) to perform additional simulations. I found that the code no longer compiles. I noticed issues in the ndnSIM-module and Internet-module headers (highlighted in Red below . I could not understand the issue. Can you please let me know the changes i need to make to make is compatible with code from earlier ndnSIM version. The error log is shown below:
>
> jkhan01 at feigenbaum:~/ndnSIM/ns-3$ ./waf --run "scratch/ns2-mobility-trace \
> --traceFile=scratch/100.tcl
> --nodeNum=100 --duration=100.0 --logFile=ns2-mobility-trace.log"
> Waf: Entering directory `/home/jkhan01/ndnSIM/ns-3/build'
> [1236/2700] Compiling scratch/koln9_1hr.cc
> In file included from /usr/include/termios.h:39:0,
> from /usr/include/boost/asio/serial_port_base.hpp:25,
> from /usr/include/boost/asio/basic_serial_port.hpp:29,
> from /usr/include/boost/asio.hpp:26,
> from ns3/ndnSIM/NFD/common.hpp:69,
> from ./ns3/ndnSIM/NFD/daemon/face/face.hpp:29,
> from ./ns3/ndnSIM/model/ndn-face.hpp:23,
> from ./ns3/ndnSIM/helper/ndn-face-container.hpp:30,
> from ./ns3/ndnSIM/helper/ndn-stack-helper.hpp:30,
> from ./ns3/ndn-all.hpp:23,
> from ./ns3/ndnSIM-module.h:10,
> from ../scratch/koln9_1hr.cc:65:
> ./ns3/icmpv4.h:39:5: error: expected identifier before numeric constant
> ECHO = 8,
> ^
> ./ns3/icmpv4.h:39:5: error: expected ‘}’ before numeric constant
> ./ns3/icmpv4.h:39:5: error: expected unqualified-id before numeric constant
> In file included from ./ns3/icmpv4-l4-protocol.h:25:0,
> from ./ns3/internet-module.h:18,
> from ../scratch/koln9_1hr.cc:72:
> ./ns3/icmpv4.h:64:26: error: non-member function ‘uint8_t ns3::GetType()’ cannot have cv-qualifier
> uint8_t GetType (void) const;
> ^
> ./ns3/icmpv4.h:69:26: error: non-member function ‘uint8_t ns3::GetCode()’ cannot have cv-qualifier
> uint8_t GetCode (void) const;
> ^
> ./ns3/icmpv4.h:76:17: error: expected unqualified-id before ‘)’ token
> Icmpv4Header ();
> ^
> ./ns3/icmpv4.h:77:26: error: declaration of ‘~ns3::Icmpv4Header’ as non-member
> virtual ~Icmpv4Header ();
> ^
> ./ns3/icmpv4.h:79:43: error: ‘virtual’ outside class declaration
> virtual TypeId GetInstanceTypeId (void) const;
> ^
> ./ns3/icmpv4.h:79:43: error: non-member function ‘ns3::TypeId ns3::GetInstanceTypeId()’ cannot have cv-qualifie
> r
> ./ns3/icmpv4.h:80:45: error: ‘virtual’ outside class declaration
> virtual uint32_t GetSerializedSize (void) const;
> ^
> ./ns3/icmpv4.h:80:45: error: non-member function ‘uint32_t ns3::GetSerializedSize()’ cannot have cv-qualifier
> ./ns3/icmpv4.h:81:51: error: ‘virtual’ outside class declaration
> virtual void Serialize (Buffer::Iterator start) const;
> ^
> ./ns3/icmpv4.h:81:51: error: non-member function ‘void ns3::Serialize(ns3::Buffer::Iterator)’ cannot have cv-qu
> alifier
> ./ns3/icmpv4.h:82:55: error: ‘virtual’ outside class declaration
> virtual uint32_t Deserialize (Buffer::Iterator start);
> ^
> ./ns3/icmpv4.h:83:41: error: ‘virtual’ outside class declaration
> virtual void Print (std::ostream &os) const;
> ^
> ./ns3/icmpv4.h:83:41: error: non-member function ‘void ns3::Print(std::ostream&)’ cannot have cv-qualifier
> ./ns3/icmpv4.h:85:1: error: expected unqualified-id before ‘private’
> private:
> ^
> ./ns3/icmpv4.h:92:1: error: expected class-name before ‘{’ token
> {
> ^
> ./ns3/icmpv4.h:108:17: error: ‘Ptr’ has not been declared
> void SetData (Ptr<const Packet> data);
> ^
> ./ns3/icmpv4.h:108:20: error: expected ‘,’ or ‘...’ before ‘<’ token
> void SetData (Ptr<const Packet> data);
> ^
> ./ns3/icmpv4.h:136:10: error: ‘TypeId’ does not name a type
> static TypeId GetTypeId (void);
> ^
> ./ns3/icmpv4.h:139:11: error: ‘TypeId’ does not name a type
> virtual TypeId GetInstanceTypeId (void) const;
> ^
> ./ns3/icmpv4.h:141:27: error: ‘Buffer’ has not been declared
> virtual void Serialize (Buffer::Iterator start) const;
> ^
> ./ns3/icmpv4.h:141:44: error: expected ‘,’ or ‘...’ before ‘start’
> virtual void Serialize (Buffer::Iterator start) const;
> ^
> ./ns3/icmpv4.h:142:33: error: ‘Buffer’ has not been declared
> virtual uint32_t Deserialize (Buffer::Iterator start);
> ^
> ./ns3/icmpv4.h:142:50: error: expected ‘,’ or ‘...’ before ‘start’
> virtual uint32_t Deserialize (Buffer::Iterator start);
> ^
> ./ns3/icmpv4.h:152:1: error: expected class-name before ‘{’ token
> {
> ^
> ./ns3/icmpv4.h:167:10: error: ‘TypeId’ does not name a type
> static TypeId GetTypeId (void);
> ^
> ./ns3/icmpv4.h:186:17: error: ‘Ptr’ has not been declared
> void SetData (Ptr<const Packet> data);
> ^
> ./ns3/icmpv4.h:186:20: error: expected ‘,’ or ‘...’ before ‘<’ token
> void SetData (Ptr<const Packet> data);
> ^
> ./ns3/icmpv4.h:191:19: error: ‘Ipv4Header’ has not been declared
> void SetHeader (Ipv4Header header);
> ^
> ./ns3/icmpv4.h:202:3: error: ‘Ipv4Header’ does not name a type
> Ipv4Header GetHeader (void) const;
> ^
> ./ns3/icmpv4.h:205:11: error: ‘TypeId’ does not name a type
> virtual TypeId GetInstanceTypeId (void) const;
> ^
> ./ns3/icmpv4.h:207:27: error: ‘Buffer’ has not been declared
> virtual void Serialize (Buffer::Iterator start) const;
> ^
> ./ns3/icmpv4.h:207:44: error: expected ‘,’ or ‘...’ before ‘start’
> virtual void Serialize (Buffer::Iterator start) const;
> ^
> ./ns3/icmpv4.h:208:33: error: ‘Buffer’ has not been declared
> virtual uint32_t Deserialize (Buffer::Iterator start);
> ^
> ./ns3/icmpv4.h:208:50: error: expected ‘,’ or ‘...’ before ‘start’
> virtual uint32_t Deserialize (Buffer::Iterator start);
> ^
> ./ns3/icmpv4.h:212:3: error: ‘Ipv4Header’ does not name a type
> Ipv4Header m_header; //!< carried IPv4 header
> ^
> ./ns3/icmpv4.h:218:1: error: expected class-name before ‘{’ token
> {
> ^
> ./ns3/icmpv4.h:229:17: error: ‘Ptr’ has not been declared
> void SetData (Ptr<const Packet> data);
> ^
> ./ns3/icmpv4.h:229:20: error: expected ‘,’ or ‘...’ before ‘<’ token
> void SetData (Ptr<const Packet> data);
> ^
> ./ns3/icmpv4.h:234:19: error: ‘Ipv4Header’ has not been declared
> void SetHeader (Ipv4Header header);
> ^
> ./ns3/icmpv4.h:245:3: error: ‘Ipv4Header’ does not name a type
> Ipv4Header GetHeader (void) const;
> ^
> ./ns3/icmpv4.h:251:10: error: ‘TypeId’ does not name a type
> static TypeId GetTypeId (void);
> ^
> ./ns3/icmpv4.h:254:11: error: ‘TypeId’ does not name a type
> virtual TypeId GetInstanceTypeId (void) const;
> ^
> ./ns3/icmpv4.h:256:27: error: ‘Buffer’ has not been declared
> virtual void Serialize (Buffer::Iterator start) const;
> ^
> ./ns3/icmpv4.h:256:44: error: expected ‘,’ or ‘...’ before ‘start’
> virtual void Serialize (Buffer::Iterator start) const;
> ^
> ./ns3/icmpv4.h:257:33: error: ‘Buffer’ has not been declared
> virtual uint32_t Deserialize (Buffer::Iterator start);
> ^
> ./ns3/icmpv4.h:257:50: error: expected ‘,’ or ‘...’ before ‘start’
> virtual uint32_t Deserialize (Buffer::Iterator start);
> ^
> ./ns3/icmpv4.h:261:3: error: ‘Ipv4Header’ does not name a type
> Ipv4Header m_header; //!< carried IPv4 header
> ^
> ./ns3/icmpv4.h:265:1: error: expected declaration before ‘}’ token
> } // namespace ns3
> ^
> ./ns3/icmpv4.h:75:17: warning: ‘ns3::TypeId ns3::GetTypeId()’ declared ‘static’ but never defined [-Wunused-fun
> ction]
> static TypeId GetTypeId (void);
> ^
>
> Waf: Leaving directory `/home/jkhan01/ndnSIM/ns-3/build'
> Build failed
>
>
> Thanks in advance.
> --
> Kind Regards,
>
> Junaid
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20160415/a258351c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20160415/a258351c/attachment.bin>
More information about the ndnSIM
mailing list