Thursday, December 15, 2011

[ns] Problem compiling ns-2: I can not include "p802.15.4.h"

Hi all

I am working with ns-2, in particular, with the wpan (IEEE 802.15.4) module. I created a new class (classEnergy) where I need to call some functions from Mac802_15_4 class. To do this, I need to include the "wpan/p802_5_4.h" header but the compiler reports the following:

In file included from ./wpan/p802_15_4phy.h:58,
                 from ./wpan/p802_15_4mac.h:57,
                 from wpan/classEnergy.cc:17:
./mac/wireless-phy.h:121: error: expected identifier before 'r'
./mac/wireless-phy.h:121: error: expected `}' before 'r'
./mac/wireless-phy.h:121: error: expected unqualified-id before 'r'
./mac/wireless-phy.h:123: error: expected unqualified-id before "private"
./mac/wireless-phy.h:123: error: expected `,' or `;' before "private"
./mac/wireless-phy.h: In function `EnergyModel* em()':
./mac/wireless-phy.h:129: error: `node' undeclared (first use this function)
./mac/wireless-phy.h:129: error: (Each undeclared identifier is reported only once for each function it appears in.)
./mac/wireless-phy.h: At global scope:
./mac/wireless-phy.h:131: error: `friend' can only be specified inside a class
./mac/wireless-phy.h:132: error: expected declaration before '}' token
In file included from ./wpan/p802_15_4phy.h:58,
                 from ./wpan/p802_15_4mac.h:57,
                 from wpan/classEnergy.cc:17:
./mac/wireless-phy.h:42:1: unterminated #ifndef
In file included from ./wpan/p802_15_4mac.h:57,
                 from wpan/classEnergy.cc:17:
./wpan/p802_15_4phy.h:53:1: unterminated #ifndef
In file included from wpan/classEnergy.cc:17:
./wpan/p802_15_4mac.h:53:1: unterminated #ifndef
make: *** [wpan/classEnergy.o] Error 1

I should note that if I don't include "p802_15_4mac.h", the problem dissapears, but I can't use mac functions( e.g. MCPS_DATA_request()).

I searched this same problem on the Web (google and ns2 help) and I found similar problems (http://www.mail-archive.com/ns-users@isi.edu/msg06434.html), but the solution has not been provided. 

I appreciate all the help possible, because I don't know what to do.

Thanks in advance

David Rodenas Herráiz

No comments:

Post a Comment

Counter

blogger analytics