I stumbled into the compilation issue after upgrading to Ubuntu Oneiric 11.10. The error occurs in "mac-802_11Ext.h" saying something like the following:
It's really simple. All you have to do is to add #include cstddef as shown below:
P.S. BlogSpot is simply terrible for posting code snippets. For clarity, here's a screenshot of what the code should look like.
mac/mac-802_11Ext.h: In member function 'u_int32_t PHY_MIBExt::getHdrLen11()':mac/mac-802_11Ext.h:175:19: error: expected primary-expression before 'struct'mac/mac-802_11Ext.h:175:41: error: 'dh_body' was not declared in this scopemac/mac-802_11Ext.h:175:51: error: 'offsetof' was not declared in this scopeI found the solution in Ubuntu's patched version of NS-2.35-RC6. The direct link to the patch is here: http://launchpadlibrarian.net/74445224/ns2_2.35~RC6-4_2.35~RC6-4ubuntu1.diff.gz
It's really simple. All you have to do is to add #include cstddef
#ifndef ns_mac_80211Ext_hNow, NS-2.34 should compile fine with GCC-4.6. Enjoy your simulation!
#define ns_mac_80211Ext_h
#include cstddef
#include "marshall.h"
#include "timer-handler.h"
P.S. BlogSpot is simply terrible for posting code snippets. For clarity, here's a screenshot of what the code should look like.
4 comments:
thanks for your post .. fixed my problem :)
by the way it should be
#include
instead of just
#include cstddef
apparently < and > are removed by blogspot
just put < before cstddef and > after it :)
:) I think Google and BlogSpot is eating up both our left/right arrow-heads. Anyways, I have added a screen-shot for better viewing - http://i.imgur.com/hMUCc.png.
Thank you :D
Post a Comment