Saturday, October 5, 2013

Error while including wireless-phy.h

The below error is solved:

./mac/wireless-phy.h:129: error: expected identifier before 'r'
./mac/wireless-phy.h:129: error: expected `}' before 'r'
./mac/wireless-phy.h:129: error: expected unqualified-id before 'r'
./mac/wireless-phy.h: In member function ‘bool& WirelessPhy::Is_node_on()’:
./mac/wireless-phy.h:97: error: ‘node_on_’ was not declared in this scope
./mac/wireless-phy.h: In member function ‘bool WirelessPhy::Is_sleeping()’:
./mac/wireless-phy.h:98: error: ‘status_’ was not declared in this scope
./mac/wireless-phy.h: At global scope:
./mac/wireless-phy.h:131: error: no matching function for call to ‘Sleep_Timer::Sleep_Timer()’
./mac/wireless-phy.h:58: note: candidates are: Sleep_Timer::Sleep_Timer(WirelessPhy*)
./mac/wireless-phy.h:56: note:                 Sleep_Timer::Sleep_Timer(const Sleep_Timer&)
./mac/wireless-phy.h:134: error: expected unqualified-id before ‘private’
./mac/wireless-phy.h: In function ‘EnergyModel* em()’:
./mac/wireless-phy.h:142: error: ‘node’ was not declared in this scope
./mac/wireless-phy.h: At global scope:
./mac/wireless-phy.h:144: error: ‘friend’ can only be specified inside a class
./mac/wireless-phy.h:146: error: expected declaration before ‘}’ token 



The error is due to duplicate link to SEND and RECV, so we need to change one of the file as shown below:

In cmu-trace.cc

- #define    RECV    'r'
- #define    SEND    's'


Rename as follows:

+ #define    RECVs    'r'
+ #define    SENDs    's'