Project

General

Profile

Actions

Bug #2662

closed

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

Added by Junxiao Shi about 9 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
03/21/2015
Due date:
% Done:

100%

Estimated time:

Description

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>
    
    int
    main()
    {
      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

fix-ndnSIM-NFD-includes.sh (574 Bytes) fix-ndnSIM-NFD-includes.sh Junxiao Shi, 03/22/2015 08:18 AM
Actions #1

Updated by Junxiao Shi about 9 years ago

Workaround:

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

This script changes all includes into relative paths.

Actions #2

Updated by Christian Kreuzberger about 9 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.

Actions #3

Updated by Junxiao Shi about 9 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 fix-ndnSIM-NFD-includes.sh 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.

Actions #4

Updated by Christian Kreuzberger about 9 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 - https://github.com/cawka/ns-3-dev-ndnSIM/tree/ndnSIM-v2 ) 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.

Actions #5

Updated by Alex Afanasyev over 8 years ago

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

Updated by Zhiyi Zhang about 6 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.

Actions

Also available in: Atom PDF