I am working with an embedded ARM device and am compiling a program. I want to minimize the memory used.
I use the GCC-ARM toolsuite to build the program. However on linkin, I get the error: /opt/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: /opt/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libstdc++.a(math_stubs_long_double.o): in function acosl': math_stubs_long_double.cc:(.text.acosl+0x0): undefined reference to
acos'
This appears not just for acos, the same error is repeated for all math functions. Due to this I am forced to link the math library via the -lm flag.
The code I am using is spread over multiple files (which is why I cannot paste it here) and I have gone through all the included headers and have found no reference to any math library function.
Due to memory constraints, I hope to remove this dependency. Is there any way to do this?