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.

CCS/CC2650: How to add files to code composer simplelink examples

Part Number: CC2650


Tool/software: Code Composer Studio

Precondition: CCS_v8 (windows and Mac)  Version: 8.2.0.00007

Issue: When I build it always errors -> fatal error #1965: cannot open source file "new_service.h"

Steps to reproduce:  1. Add files to project by left clicking on simple_peripheral_cc2650lp_app and creating new .c .h files. Include new .h file in simple_peripheral.c -> build -> ERROR

2. Create the files in a location in a  directory in project workspace  -> Add files to virtual folder by linking using the advanced option when creating new file from virtual folder. -> Add .h file to simple_peripheral.c -> build -> Error 

  • Hello Jonathan,

    use File -> New -> Header File to add a new header file.
  • Jonathan Moss said:
    Steps to reproduce:  1. Add files to project by left clicking on simple_peripheral_cc2650lp_app and creating new .c .h files. Include new .h file in simple_peripheral.c -> build -> ERROR

    I assume you followed these steps to create/add a new header file. 

    - Imported simple_peripheral_cc2650lp_app from BLE SDK
    -Right-click on simple_peripheral_cc2650lp_app, go to New->Header file and create a .h file, say test.h
    - Open simple_peripheral.c and #include "test.h"

    Is this correct? If so, the file test.h will be placed in the root folder of the project, while simple_peripheral.c is is a linked resource that physically resides in a directory within the SDK. When building a project, the compiler needs to know where to find all header files. If the header file is not in the same directory as the source file which #includes it, then the path to it should be provided to the compiler via the --include_path option.

    If the header file is indeed in the root directory of the project, then you can add ${PROJECT_ROOT} to the compiler's --include_path options as shown below.