Hi.
I've a problem with an application that I'm developing.

In this application, I've three projects:

A - The application
B - a library used by the application
C - a library used by B

in the B project, I declare the class in his header file (libB.h), like this:

Qt Code:
  1. #include "libB_global.h"
  2. #include "libC.h"
  3.  
  4. class METEOGRIDSHARED_EXPORT AtmosphericGrid
  5. {
  6.  
  7. ... some code using library C
  8.  
  9. }
To copy to clipboard, switch view to plain text mode 

To do this, in the .pro of the B project I add the path in which the class header of library C is defined, and I add the header of that class, so che .pro of the library B contains something like this:

Qt Code:
  1. # Including project C
  2. INCLUDEPATH += ../../libC
  3. HEADERS += libC.h
To copy to clipboard, switch view to plain text mode 

Now, in the application A, I want to use library B. To do this, I add in the .pro file of A application, the following lines:

Qt Code:
  1. # Using B Library
  2. DEFINES -= B_LIBRARY
  3. LIBS += ../../bin/libB.so
  4. INCLUDEPATH += ../../B
  5. HEADERS += libB.h
To copy to clipboard, switch view to plain text mode 

But, if I do this, I've a compiler error:

In file included from ../A/main.cpp:5:0:
../../libB/libB.h:6:29: fatal error: libC.h: missing file or directory
(the message cannot be equal, because I've translated it from italian).

In practice, it does not compile because in A I've a reference for the C header (included in the B header).
In other words, to compile A, I need header B, that includes header C that I must define in A. If I don't define C path in A, it doesn't work But I don't want to do this, because I lost all advantages in using different projects.

I'd like that A depends only from B, withouht taking in account all dependies of B, but it'a impossible if I use header files as I'a actually doing.
How can I achieve this result?

Thanks in advance for your replies.