This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Compilation Error

Hi, 

I try to add BLE scanning function to receive all the advertising data in my application.

My existing application is started from advertising example.

After added scanning function, I encounter compilation error.

"nrf_ble_scan.h: No such file or directory"

 

I already enabled below in the sdk_config.h

// <e> NRF_BLE_SCAN_ENABLED - nrf_ble_scan - Scanning Module
//==========================================================
#ifndef NRF_BLE_SCAN_ENABLED
#define NRF_BLE_SCAN_ENABLED 1
#endif

Please advise how to resolve.

Thanks.

Parents
  • Hi,

    You don't specify what you're using to compile the example, but if you're using SEGGER Embedded Studio (SES) there are two options you can try, and it's possible you have to do both:

    • Add the path of nrf_ble_scan.h to user include directories. You can do this by right clicking on your project in the project explorer in SES, "Project '<project_name>'", and then selecting Options > Preprocessor > User Include Directories. Make sure that configurations is set to common, and not debug or release. The missing file, nrf_ble_scan.h, is located in /components/ble/nrf_ble_scan so you should add the following to user include directories:
      ../../../../../../components/ble/nrf_ble_scan
      This uses relative path, so please make sure that the path is correct. This path is taken from the ble_app_hrs_c example, and if your example is at a different depth with regards to folders than this example, adjust the path accordingly. You probably already have some user include directories from the components directory, so you can use that to see how many ../../ you need.
    • Add the file to the project. Right click on the "nRF_BLE" folder located under your project in the project explorer and select "Add Existing File". Find the file, which as I mentioned is located in /components/ble/nrf_ble_scan and add it. Make sure to select C Header Files or All Files as filetype in the file explorer so it's visible. If you see that nrf_ble_scan.c is missing in addition to the header file in "nRF_BLE" folder, add that one as well.

    Best regards,

    Marte

Reply
  • Hi,

    You don't specify what you're using to compile the example, but if you're using SEGGER Embedded Studio (SES) there are two options you can try, and it's possible you have to do both:

    • Add the path of nrf_ble_scan.h to user include directories. You can do this by right clicking on your project in the project explorer in SES, "Project '<project_name>'", and then selecting Options > Preprocessor > User Include Directories. Make sure that configurations is set to common, and not debug or release. The missing file, nrf_ble_scan.h, is located in /components/ble/nrf_ble_scan so you should add the following to user include directories:
      ../../../../../../components/ble/nrf_ble_scan
      This uses relative path, so please make sure that the path is correct. This path is taken from the ble_app_hrs_c example, and if your example is at a different depth with regards to folders than this example, adjust the path accordingly. You probably already have some user include directories from the components directory, so you can use that to see how many ../../ you need.
    • Add the file to the project. Right click on the "nRF_BLE" folder located under your project in the project explorer and select "Add Existing File". Find the file, which as I mentioned is located in /components/ble/nrf_ble_scan and add it. Make sure to select C Header Files or All Files as filetype in the file explorer so it's visible. If you see that nrf_ble_scan.c is missing in addition to the header file in "nRF_BLE" folder, add that one as well.

    Best regards,

    Marte

Children
No Data
Related