Error in a ns-3 simulation?

253 Views Asked by At

I am trying to run a simulation but I keep getting some kind of error. I am not an expert on C++, but I think it's due to header file include. I am getting the following error:

error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
 void OutInterest(Ptr<const ns3::ndn::InterestHeader> interestHeader,Ptr<const ns3::ndn::Face> face) {
                            ^
../scratch/vndn_simulation.cc:87:52: error: template argument 1 is invalid
 void OutInterest(Ptr<const ns3::ndn::InterestHeader> interestHeader,Ptr<const ns3::ndn::Face> face) {
                                                    ^
../scratch/vndn_simulation.cc:87:28: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
 void OutInterest(Ptr<const ns3::ndn::InterestHeader> interestHeader,Ptr<const ns3::ndn::Face> face) {

Any idea on how to solve this error?

1

There are 1 best solutions below

0
On

It says here:

class NameComponents;
       ^
In file included from ./ns3/ndn-v2v-net-device-face.h:31:0,
                 from ../scratch/vndn_simulation.cc:15:
./ns3/ndn-header-helper.h:34:21: note: ‘ns3::ndn::NameComponents’ has a previous declaration here
        typedef Name NameComponents;
                     ^

that you cannot forward declare NameComponents because the compiler has already seen that it is a typedef and not a class.