I have the same problems when I tried to install ns. The problem is: in geog.c file, "#include <sys/type.h>" was commented off. You need to add this in and recompile ns. It should be okay then. Hope this helps. Huiwen