none
Combined relative include path too long for compiler's file access

    Question

  • Hi,

    I'm having a problem with the length of relative include paths.

    The scenario:

    The Projekt
    L:\platform\pilz_os\unit_test\VS\abstraction_layer\os_specific\microc_os_ii\Test_OS_API_System\OS_API_SYSTEM_eDoStackIntegrityCheckForSingleTask\OS_API_SYSTEM_eDoStackIntegrityCheckForSingleTask.vcproj

    contains a source code file
    ..\..\..\..\..\..\..\src\sw\kernel\impl\os_abstraction\microc_os_ii\OS_API_System.c

    which includes the header file
    ../../../pos_intf/OS_POS_GenericHelpFunctions.h

    The combination of these relative paths results in
    L:\platform\pilz_os\unit_test\VS\abstraction_layer\os_specific\microc_os_ii\Test_OS_API_System\OS_API_SYSTEM_eDoStackIntegrityCheckForSingleTask\..\..\..\..\..\..\..\src\sw\kernel\impl\os_abstraction\microc_os_ii\../../../pos_intf/OS_POS_GenericHelpFunctions.h

    This combined path however is too long for the Visual Studio compiler and so the include header file cannot be opened:
    ..\..\..\..\..\..\..\src\sw\kernel\impl\os_abstraction\microc_os_ii\OS_API_System.c(25) : fatal error I10717: cannot open source file "../../../pos_intf/OS_POS_GenericHelpFunctions.h"
    #include "../../../pos_intf/OS_POS_GenericHelpFunctions.h"

    Is there a way to tell the Visual Studio compiler to reduce such a path to:
    L:\platform\pilz_os\src\sw\kernel\pos_intf\OS_POS_GenericHelpFunctions.h

    Thanks for any idea how to solve this.

    Regards
    Dennis

    Monday, May 30, 2016 9:12 AM

Answers