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.

CC3220SF: Cannot open source file <netinet/in.h>

Part Number: CC3220SF

Hello,

I am trying to port tcpHandler function from tcpecho example to cloud_ota project. 

while compiling after porting the function to cloud_ota project compiler returns an error

#1965 cannot open source file "netinet/in.h" 

same goes with other BSD support files

/* BSD support */
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>

I don't understand why including header files get compiled in one project and cannot in another project.

Can someone please help me resolve this issue.

Thank you,

Kris.

  • Hi Kris,

    The cloud_ota example does not use the BSD library. You must add the bsd path to your compiler Include Options in your project properties:

    ${COM_TI_SIMPLELINK_CC32XX_SDK_INSTALL_DIR}/source/ti/net/bsd

    If you find you are missing other include or linker build options, please check the project properties in the tcpecho example as a reference.

    Best regards,

    Sarah

  • Thank you for the help Sarah, I got pass through that error.

    I checked all the project properties in tcpecho and added the source paths in the cloud_ota example. Now, I am getting a different error.while linking

    Description Resource Path Location Type
    unresolved symbol ErrnoUtil_set, first referenced in ./tcpEcho.obj cloud_ota_CC3220SF_LAUNCHXL_tirtos_ccs C/C++ Problem
    unresolved symbol SlNetSock_close, first referenced in ./tcpEcho.obj cloud_ota_CC3220SF_LAUNCHXL_tirtos_ccs C/C++ Problem

    <Linking>

    undefined first referenced
    symbol in file
    --------- ----------------
    ErrnoUtil_set ./tcpEcho.obj
    SlNetSock_close ./tcpEcho.obj

    I tried adding #include <errnoutil.h> from C:\ti\simplelink_cc32xx_sdk_3_30_01_02\source\ti\net\bsd. Still I see the same error.

    I am not sure why this error is arising. Can you please help me resolve this.

    Thank you,

    Kris.

  • Hi Kris,

    Have you added the network services library to the build linker?

    ${COM_TI_SIMPLELINK_CC32XX_SDK_INSTALL_DIR}/source/ti/net/lib/ccs/m4/slnetsock_release.a

    Best regards,

    Sarah

  • I added and it worked, Thank you, Sarah!