What do you mean you "cannot execute it separately"??
I understand you have added a module consisting of some .cc and .h files to an existing project. But exactly what are you having problems with?
Are you having problems compiling? Or are you having problems actually using the functionality you have added? Can you provide any more information? I don't fully understand the nature of your problem.
After a bit of duckduckgo-fu, I assume that the ns2.34 you are talking about is the network simulator... Can't say I am familiar with it, but if you explain your problem more clearly, I, or somebody else here may be able to help you.
Also, a bit more duckduckgo-fu yielded this: Click here - A blog post from 2010, written by somebody who has created their own module for ns2.34.
There is a white-paper and source code available in the post. You could perhaps take a look at their code and see how the implementation of their module differs from yours.
Looking at the code available on that page, it looks like adding a module to ns2.34 involves adding your cc/h files to the source tree of ns2.34; modifying the ns2.34 makefiles to include your module; re-building ns2.34 and finally writing a tcl script that you can run in ns2.34 to test your module.
Hopefully some of that helps. Otherwise, post again with more information.