omnet++inet

OMNeT++ file not found error c++ includes not working


I am trying to update a OMNeT++ and INET library for PTP simulations from omnet++ 4.6 to latest Omnet++ 6.0. My problem is the library’s c++ files that use include statements. With the following project structure

/src/
/src/Clock/
/src/Hardware/

files in Clock directory that includes files from Hardware directory are not found. As I understand OMNeT++ should be smart enough to automatically find files so I don't have to type the absolute path or relative path. Any ideas?

Looking for answers I have come across suggestions to make changes to Makemake under for the src folder but I am referencing documents inside of the src folder so this is not the problem.


Solution

  • Indeed. Newer versions of OMNeT++ do NOT add all possible directories in the source tree to the include path. This means that you MUST use include path relative to the root of the project's source directory.

    (there is a reason for this: if two header files with the same name exist in different directories, any C++ files including them without a path prefix would get one of them randomly, which is definitely not a smart choiche.)

    Long story short, you must add the prefix paths manually during the porting process.