This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

#include file in a subdirectory

Hi,

I'm using the C166 compiler. I'm trying to restructure a project, and wanted to put serveral related files in a subdirectory, say "thing". We have several source and header files that look like

./thing1_this.c
./thing1_this.h
./thing1_that.c
./thing1_that.h
./thing2_this.c
./thing2_this.h

I want to create subdirectories

thing1/

and and

thing2/

and to move these to

thing1/
  thing1/this.c
  thing1/this.h
  thing1/that.h
  thing1/that.h
thing2/
  thing2/this.c
  thing2/that.h

Then the files which include the header files would go from

#include "thing1_this.h"
#include "thing1_that.h"
#include "thing2_this.h"

to this:

#include "thing1/this.h"
#include "thing1/that.h"
#include "thing2/this.h"

The compiler can't find the header files in this configuration. I've tried other path separators ('\\', '\'), but to no avail. I have './' explicitely in my

INCDIR(...)

directive.

I've also made sure that the directory name is within DOS filename limits.

The description of the include search method in the manual was very sparse, and I could find nothing on the forums how this might be done or whether the compiler could do this at all.

Is this a limitation of the compiler that the preprocessor doesn't know how to include file paths? Or is their some syntax I haven't tried?

If I must I can put

./thing1

and

./thing2

in my

INCDIR(...)

directive and name this files like this:

thing1/
  thing1/thing1_this.c
  thing1/thing1_this.h
  thing1/thing1_that.h
  thing1/thing1_that.h
thing2/
  thing2/thing2_this.c
  thing2/thing2_that.h

but my original setup is better, and I'd like to do that if I can.

Thanks Much.

Parents Reply Children