Error: MBED / Nordic Semi BLE includes <algorithm> into C-Files

Hi,

I’m puzzled. While working inside the Web-IDE works great, exporting the project to GCC does not compile.

The compiler claims that it cannot find . What is completely right, as this file is included inside a .h file, and this .h file is included from a .c file ( not .cpp) and the cpp-compiler knows nothing about the includes for some stl files.

This error has been introduced within the last month, as I could compile the code before perfectly.

I tried both the 4.2 and the 5.2 compilers - No Luck :frowning:

Any idea?

BR
tuxscreen

In file included from ./BLE_API/ble/Gap.h:20:0,
from ./BLE_API/ble/ble.h:21,
from nRF51822/source/nordic_sdk/components/ble/ble_services/ble_dfu/ble_dfu.h:53,
from nRF51822/source/nordic_sdk/components/ble/ble_services/ble_dfu/ble_dfu.c:33:
./BLE_API/ble/BLEProtocol.h:22:21: fatal error: algorithm: No such file or directory
compilation terminated.
make: *** [nRF51822/source/nordic_sdk/components/ble/ble_services/ble_dfu/ble_dfu.o] Error 1

I’m puzzled. While working inside the Web-IDE works great, exporting the project to GCC does not compile.

Are you referring to mbed 2 online compiler? What toolchain are you using? version? C file ? Can you provide a simple example? or more specific details

Hi,

the error is caused by:

  • compiling with Windows (not case-sensitive file-system)
  • and that you have two files in BLE_API and NRF51 SDK that are both called “ble.h/BLE.h”

See fix here:
https://github.com/adamgreen/gcc4mbed/commit/61ae5063846cc8412890e051f0a7dd59967ce8ff

Do you think that might be better fixed in your repository?

BR
Marc

Thanks for reporting it. There was an issue created in BLE repository, BLE.h conflict with Nordic SDK ble.h · Issue #177 · ARMmbed/ble · GitHub . Please track this issue.