Skip to content

[bug] String.cpp: undefined reference to ltoa and ultoa #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Guswib opened this issue Feb 2, 2025 · 4 comments
Open

[bug] String.cpp: undefined reference to ltoa and ultoa #112

Guswib opened this issue Feb 2, 2025 · 4 comments
Assignees
Labels
bug Something isn't working fix in next release

Comments

@Guswib
Copy link

Guswib commented Feb 2, 2025

Hardware

Arduino Nano Matter

Core version

2.20

Arduino IDE version

2.3.4

Operating system

Windows 10

Radio stack variant

No radio

OpenThread Border Router device (if using Matter)

No response

Issue description

During compilation in the arduino IDE, the following error message is given:

/appdata/local/arduino15/packages/siliconlabs/tools/gcc-arm-none-eabi/12.2.rel1/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: \AppData\Local\arduino\sketches\D54C9E1FF4DB4B8DD7CB06F3C73E69AA/core\core.a(String.cpp.o): in function arduino::String::String(long, unsigned char)': <user>\AppData\Local\Arduino15\packages\SiliconLabs\hardware\silabs\2.2.0\cores\silabs\api/String.cpp:113: undefined reference to ltoa'
/appdata/local/arduino15/packages/siliconlabs/tools/gcc-arm-none-eabi/12.2.rel1/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: \AppData\Local\arduino\sketches\D54C9E1FF4DB4B8DD7CB06F3C73E69AA/core\core.a(String.cpp.o): in function arduino::String::String(unsigned long, unsigned char)': <user>\AppData\Local\Arduino15\packages\SiliconLabs\hardware\silabs\2.2.0\cores\silabs\api/String.cpp:121: undefined reference to ultoa'

Serial output

No response

RTT output (if using Matter)

No response

Minimal reproducer code

void setup() {
// put your setup code here, to run once:
long l_num=10;
String(l_num,10);
unsigned long ul_num=10;
String(ul_num,10);

}

void loop() {
// put your main code here, to run repeatedly:

}

@Guswib Guswib added the bug Something isn't working label Feb 2, 2025
@leonardocavagnis
Copy link
Contributor

leonardocavagnis commented Feb 27, 2025

Dear @Guswib,
Thanks for reporting this issue.

Currently, the itoa library is missing. 😞

If you need it, you can copy and paste this itoa.c implementation into the core/silabs folder (but remember to remove this line: #include <api/deprecated-avr-comp/avr/dtostrf.c.impl>).

If you'd like to contribute, feel free to open a PR with this fix!

@Guswib
Copy link
Author

Guswib commented Mar 6, 2025

Dear @leonardocavagnis,

I will have a look andn hope to find a solution.

Cheers
G

@Guswib
Copy link
Author

Guswib commented Mar 6, 2025

Hi,
The cloning of the repo does not work:


Cloning into 'C:\Users\gusta\Documents\GitHub\CoreFIX\arduino2'...
remote: Enumerating objects: 6405, done.
remote: Counting objects: 100% (1157/1157), done.
remote: Compressing objects: 100% (660/660), done.
remote: Total 6405 (delta 524), reused 992 (delta 441), pack-reused 5248 (from 1)
Receiving objects: 100% (6405/6405), 47.02 MiB | 1.65 MiB/s, done.
Resolving deltas: 100% (2880/2880), done.
Updating files: 100% (19279/19279), done.
Downloading variants/bgm220explorerkit/ble_silabs/gsdk.a (3.4 MB)
Error downloading object: variants/bgm220explorerkit/ble_silabs/gsdk.a (d1cd1d1): Smudge error: Error downloading variants/bgm220explorerkit/ble_silabs/gsdk.a (d1cd1d13de51480e6c7a8d4346b3d073ae5fafa23a0a9ad8621fdbbb8cc2a2fc): [d1cd1d13de51480e6c7a8d4346b3d073ae5fafa23a0a9ad8621fdbbb8cc2a2fc] Object does not exist on the server: [404] Object does not exist on the server

Errors logged to 'C:\Users\gusta\Documents\GitHub\CoreFIX\arduino2.git\lfs\logs\20250306T160839.2974214.log'.
Use git lfs logs last to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: variants/bgm220explorerkit/ble_silabs/gsdk.a: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
This error also occures but for other .a files

@silabs-bozont
Copy link
Collaborator

Hello @Guswib,
Thank you for the bug report! It seems like @leonardocavagnis was right - we're missing the implementation of itoa ltoa utoa and ultoa.
I've added them - they'll be included in the next release.

About the cloning issue - it seems like the LFS artifacts haven't been published correctly - I'll look into putting them out. They're in the release archives but seems to be missing from git.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix in next release
Projects
None yet
Development

No branches or pull requests

3 participants