I have installed ns-2.28 on ubuntu 12.04. My kernel version is 3.2.0-29-generic-pae. What gcc version matches my ns-2.28 & 3.2.0-29-generic-pae?
That is supposed to be done by Ubuntu Maintainers in their repository unless you build it from sources (a bad practice to new bees which I presume you did not do). So just install the package needed, that is: