Which code ? Name(s) and a link, please.
A few of the protocols available can be used for ns-2.35 .
The most are for older versions.
The good news : You can have as many versions of ns-allinone-2.xx
as you want, installed at the same time.
! But do not add any *PATH text to .bashrc .
All versions ns-allinone-2.26 ... 2.34 compiles OK with Fedora :
$ cd ns-allinone-2.xx/ && export CC=gcc34 CXX=g++34 && ./install
-