Bug #2662

scenario template: fatal error: common.hpp: No such file or directory

Added by Junxiao Shi over 6 years ago. Updated over 3 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


Steps to reproduce:

  1. install ndnSIM
  2. clone ndnSIM-scenario-template
  3. create file ndnSIM-scenario-template/scenarios/hello.cpp with following code:

    #include <ns3/ndnSIM-module.h>
      return 0;
  4. execute ./waf configure followed by ./waf

Expected: code builds

Actual: include/ns3-dev/ns3/ndnSIM/NFD/daemon/face/face.hpp:29:22: fatal error: common.hpp: No such file or directory

Files (574 Bytes) Junxiao Shi, 03/22/2015 08:18 AM

Updated by Junxiao Shi over 6 years ago


AFTER installation, run attached script in /usr/local/include/ns3-dev/ns3/ndnSIM/NFD.

This script changes all includes into relative paths.


Updated by Christian Kreuzberger over 6 years ago

Confirming this, I've ran into the same problem.
I'm not sure if fixing the includes is the solution to this, I'm pretty sure the appropriate links need to be set in the scenario templates wscript file, as the scenarios usually run very well in the ns-3/scratch subfolder.


Updated by Junxiao Shi over 6 years ago

System headers (those installed to /usr/include or /usr/local/include) should use relative paths to reference to other headers from the same package, but some headers in ns3/ndnSIM/NFD are not using correct relative paths.

The script changes those includes to relative paths.

This step can be moved to ndnSIM's wscript before installing.

Changing scenario template's wscript or ndnSIM's .pc to add additional include search paths is incorrect, because this can cause name conflicts.

For example, if user creates a common.hpp in the scenario, #include "common.hpp" would find user's common.hpp instead of NFD's common.hpp.


Updated by Christian Kreuzberger over 6 years ago

I can absolutely see your point, and I agree with it - the problem is however not situated in the scenario, but in the original ndnSIM core.
Anyway, the problem seems to be resolved for me by checking out the latest version of the modified ns-3 (including modified build scripts - ) and then re-compiling the whole thing.

Though I would prefer to have relative includes within ndnSIM - at least for files that are included in scenarios.


Updated by Alex Afanasyev about 6 years ago

  • Status changed from New to Closed
  • Target version set to 2.1
  • % Done changed from 0 to 100

Updated by Zhiyi Zhang over 3 years ago

Will anyone fix this? This problem still exists even after two years. I got similar problem caused by the same problem.

/usr/local/include/ns3-dev/ns3/ndnSIM/model/ndn-common.hpp:38:10: fatal error: 'NFD/daemon/face/face.hpp' file not found
#include "NFD/daemon/face/face.hpp"

After I change it to #include "../NFD/daemon/face/face.hpp", this error got fixed but new more errors came :(. All because of include path.

Also available in: Atom PDF