stm32-for-vscode: Can't get cmath or math.h working
I’m building with c++ main and whenever i use #include <cmath> to get floating point operations it doesn’t compile with error:
fatal error: bits/c++config.h: No such file or directory
From what i can gather it’s a linker problem, and by default it doesn’t include some parts. I’ve read that adding -lm flag to linker is the solution, but yaml config only have cFlags and cxxFlags. I tried both, it doesn’t help
EDIT: managed to get it working
Solution is really jank, but at least it works for now. I just copied all the files from ..\bmd.stm32-for-vscode\@xpack-dev-tools\arm-none-eabi-gcc\10.3.1-2.3.1\.content\arm-none-eabi\include\c++\10.3.1\arm-none-eabi\bits folder to ..\bmd.stm32-for-vscode\@xpack-dev-tools\arm-none-eabi-gcc\10.3.1-2.3.1\.content\arm-none-eabi\include\bits
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 16 (8 by maintainers)
Finally got around to checking this out. It does seems that this is an issue with the length of the path. I moved the arm-none-eabi folder to my user directory and changed my settings to point to this arm toolchain folder and then it seems to work. @yamaan93 could you verify this? If so I can take it into account for a next release.