This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/AM3357: Cannot find include file <sys/type.h>

Part Number: AM3357
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI C/C++ Compiler

I am porting libcurl (https://curl.haxx.se) to TI-RTOS, but I am encountering errors that certain include files cannot be found along my include path.

Description Resource Path Location Type
cannot open source file "sys/types.h" stdcheaders.h  /Teller-ExEl/source/cURL/include/curl  line 25 C/C++ Problem

  • Hi,

    Could you show me what your Project's include options are?

    Thanks,
    Gerardo
  • Gerardo,

    I am using Code Composer Studio Version: 6.1.0.00104

    Here are my include options:

    "${CG_TOOL_ROOT}/include"
    "${PROJECT_ROOT}/include"
    "${NDK_INSTALL_DIR}/packages/ti/ndk/inc/"
    "${PROJECT_ROOT}/source"
    "${PROJECT_ROOT}/source/task"
    "${PROJECT_ROOT}/source/board/expertelite"
    "${PROJECT_ROOT}/source/board/pro2"
    "${workspace_loc:/${ProjName}/source/cURL/include}"
    "${workspace_loc:/${ProjName}/source/cURL/lib}"
    "${PROJECT_ROOT}/source/ti/Intrinsics"
    "${PROJECT_ROOT}/source/ti/include/armv7a/am335x"
    "${PROJECT_ROOT}/source/ti/include/armv7a"
    "${PROJECT_ROOT}/source/ti/include/hw"
    "${PROJECT_ROOT}/source/ti/include"
    "${PROJECT_ROOT}/source/usblib/include"
    "${PROJECT_ROOT}/source/crypto"
    "${PROJECT_ROOT}/source/hscd"
    "${PROJECT_ROOT}/source/zlib"
    "${PROJECT_ROOT}/source/ti/am335x_sysbios_ind_sdk/starterware/include"
    "${PROJECT_ROOT}/source/ti/am335x_sysbios_ind_sdk/platform/am335x/include"
    "${PROJECT_ROOT}/source/ti/os_drivers/include"
    "${PROJECT_ROOT}/source/ti/os_drivers/include/ICSS"
    "${PROJECT_ROOT}/source/ti/os_drivers/include/CPSW"
    "${PROJECT_ROOT}/source/capi/include"
    "${PROJECT_ROOT}/source/capi/include/sysbios"
    "${PROJECT_ROOT}/source/REST"
    "${PROJECT_ROOT}/source/wslib/include"
    "${PROJECT_ROOT}/source/wslib/platform/sysbios/include"
    "C:\ti\ccsv6\tools\compiler\ti-cgt-arm_16.12.0.STS\include"

    Best regards,

    George

  • Hi George,

    Could you add the following to your include path and see if that fixes your error:
    "${BIOS_CG_ROOT}/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/include"

    Thanks,
    Gerardo
  • I added your suggestion to the include path, and I now receive these errors.

    Description Resource Path Location Type
    invalid redeclaration of type name "time_t" (declared at line 109 of "C:/ti/bios_6_45_01_29/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/include/sys/types.h") .ccsproject /Teller-ExEl-EDS line 104, external location: C:\ti\ccsv6\tools\compiler\ti-cgt-arm_16.12.0.STS\include\time.h C/C++ Problem
    invalid redeclaration of type name "clock_t" (declared at line 104 of "C:/ti/bios_6_45_01_29/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/include/sys/types.h") .ccsproject /Teller-ExEl-EDS line 79, external location: C:\ti\ccsv6\tools\compiler\ti-cgt-arm_16.12.0.STS\include\time.h C/C++ Problem

    From C:/ti/bios_6_45_01_29/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/include/sys/types.h, the surrounding code is

    #ifndef __time_t_defined
    typedef _TIME_T_ time_t;
    #define __time_t_defined

    From C:\ti\ccsv6\tools\compiler\ti-cgt-arm_16.12.0.STS\include\time.h

    #if defined(_TARGET_DEFAULTS_TO_TIME64) || \
    (defined(__TI_TIME_USES_64) && __TI_TIME_USES_64)
    typedef __time64_t time_t;
    #else
    typedef __time32_t time_t;
    #endif

  • Hi George,

    I didn't see you were using TI compiler, TI compiler doesn't include a defintion for sys/types.h so you would need to create your own to define any types that are needed. The include path I gave you is for gcc which is why it gave you issues, another option would be to change your compiler but I'm not sure if that may be a possibility for your project.

    Hope that helps,
    Gerardo
  • There was a suggested answer and since there has been no active on this thread for more than a week, the suggested answer was marked as verify. Please feel free to select the "Reject Answer" button and reply with more details.