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

how to specify header files easily, like searching subdirectory

Do we have to specify the header files' path which are located in different directories one by one directory ? Can I just specify the general directory ,and letting the mdk itself searching header files in sub-directories?

There are too many sub-directories,and it's taking a lot of time. Can anyone help me please? Thx!

Parents
  • I normally use relative path in the source files if I need a number of subdirectories.

    So

    /* main.c */
    #include "com/magic_protocol_1.h"
    #include "com/magic_protocol_2.h"
    #include "i2c/eeprom.h"
    #include "spi/modem.h"
    ...
    

    The source files in their subdirectories can manage with just:

    /* i2c/eeprom.h */
    #include "eeprom.h"
    
    ...
    
    /* spi/modem.c */
    #include "modem.h"
    #include "modem_commands.h"
    #include "modem_compression.h"
    ...
    

    Then I don't need a huge number of include directories specified for the project, even if the project has many 100k of source lines spread over a large number of source files.

Reply
  • I normally use relative path in the source files if I need a number of subdirectories.

    So

    /* main.c */
    #include "com/magic_protocol_1.h"
    #include "com/magic_protocol_2.h"
    #include "i2c/eeprom.h"
    #include "spi/modem.h"
    ...
    

    The source files in their subdirectories can manage with just:

    /* i2c/eeprom.h */
    #include "eeprom.h"
    
    ...
    
    /* spi/modem.c */
    #include "modem.h"
    #include "modem_commands.h"
    #include "modem_compression.h"
    ...
    

    Then I don't need a huge number of include directories specified for the project, even if the project has many 100k of source lines spread over a large number of source files.

Children