10 years, 3 months ago.

Allowed locations for include files

I'm importing some code that we written with very structured directories: they look like this:

file structure

 \Reader-Lib
      \comps
            \phacDiscLoop
                 \src
                    \Sw
                      aprogramfile.c
       \types
            ph_typdefs.h

The problem I'm having is that I can't seem to add an include line that can reference the h file.

the original code read:

include

#include <ph_typdefs.h> 

I've tried

include

#include <../../../../types/ph_typdefs.h> 

and substituted quotes, use '\' instead of '/' and tried other levels of depth to no avail. Can anyone guide me as to how to make this work?

Does it help if you use #include "header_file" ? Anyway, this should work out of the box. Can you create a repo with just like 2 files for quickly reproducing the issue?

posted by Martin Kojtal 15 Sep 2014

Have you tried doing the following?

#include "../../../../types/ph_typdefs.h"
posted by Austin Blackstone 15 Sep 2014
Be the first to answer this question.