arduino / arduino/ArduinoCore-mbed
ARDUINO_AS_MBED_LIBRARY example fails to build
- Dominant language
- C
- Stars
- 411
- Forks
- 225
- PR merge metrics
- No merged PRs in 30d
Description
I've tried to build an mbed app using the Arduino code as a library, as per the example in this commit...
https://github.com/arduino/ArduinoCore-mbed/commit/26b6c021d9ca639e0a6da6edc80e13e3dc501dfb
When I try to compile, I get these errors...
`% mbed compile -m ARDUINO_NANO33BLE -t GCC_ARM
[mbed] Working path "/Users/gingerjinjo/Documents/mbed_arduino/test" (program)
Building project test (ARDUINO_NANO33BLE, GCC_ARM)
Scan: test
Compile [ 0.8%]: String.cpp
[Error] String.cpp@45,23: 'strlen' was not declared in this scope
[Error] String.cpp@200,2: 'memcpy' was not declared in this scope
[Error] pgmspace.h@63,29: 'strcpy' was not declared in this scope
[Error] String.cpp@254,23: 'strlen' was not declared in this scope
[Error] pgmspace.h@69,21: 'strlen' was not declared in this scope
[Error] String.cpp@283,2: 'memcpy' was not declared in this scope
[Error] String.cpp@292,22: 'strlen' was not declared in this scope
[Error] pgmspace.h@69,21: 'strlen' was not declared in this scope
[Error] pgmspace.h@63,29: 'strcpy' was not declared in this scope
[Error] String.cpp@453,9: 'strcmp' was not declared in this scope
[Error] String.cpp@463,9: 'strcmp' was not declared in this scope
[Error] String.cpp@475,9: 'strcmp' was not declared in this scope
[Error] String.cpp@500,9: 'strncmp' was not declared in this scope
[Error] String.cpp@506,9: 'strcmp' was not declared in this scope
[Error] String.cpp@548,2: 'strncpy' was not declared in this scope
[Error] String.cpp@564,21: 'strchr' was not declared in this scope
[Error] String.cpp@577,22: 'strstr' was not declared in this scope
[Error] String.cpp@592,15: 'strrchr' was not declared in this scope
[Error] String.cpp@609,7: 'strstr' was not declared in this scope
[Error] String.cpp@649,21: 'strstr' was not declared in this scope
[Error] String.cpp@650,4: 'memcpy' was not declared in this scope
[Error] String.cpp@655,21: 'strstr' was not declared in this scope
[Error] String.cpp@664,4: 'memmove' was not declared in this scope
[Error] String.cpp@667,4: 'memcpy' was not declared in this scope
[Error] String.cpp@672,21: 'strstr' was not declared in this scope
[Error] String.cpp@681,4: 'memmove' was not declared in this scope
[Error] String.cpp@684,4: 'memcpy' was not declared in this scope
[Error] String.cpp@703,2: 'memmove' was not declared in this scope
[Error] String.cpp@731,22: 'memmove' was not declared in this scope
[ERROR] ./ArduinoCore-API/api/String.cpp: In constructor 'arduino::String::String(const char*)':
./ArduinoCore-API/api/String.cpp:45:23: error: 'strlen' was not declared in this scope
45 | if (cstr) copy(cstr, strlen(cstr));
| ^~~~~~
./ArduinoCore-API/api/String.cpp:28:1: note: 'strlen' is defined in header ''; did you forget to '#include '?
27 | #include
+++ |+#include
28 |
... and so on.
Am I doing something wrong, or is it broken again? It looks like the Arduino API is failing to find the write mbed bits. I'm on a Mac.
Thanks
`
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the ARDUINO_AS_MBED_LIBRARY example from commit 26b6c021d9ca639e0a6da6edc80e13e3dc501dfb using the shown mbed compile command. Start with ArduinoCore-API/api/String.cpp and the reported pgmspace.h errors; done means the example builds without the missing strlen, memcpy, and related declarations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- arduino, cpp
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100