Float libraries undefined, "powf", "logf", and many more #11412
-
Hello, I'm working on a project in which the processor is by XMOS, and as of now MicroPython doesn't support the processor, so I've modified the minimal port by replacing the HAL layer to be able to work for it. To do so, I've used the sample code of other ports (STM and Microchip) as a reference and developed the HAL layer myself (timer, gpio and other modules). I've also modified the compilation process and made it very straightforward (updated the makefile a little). Now I'm building an advanced application to support the overall software, where I want to do a cross-compile to the same code for the Linux environment. So I can use it for the simulation of the script (also testing of the modular library). I tried to replace the xcc (XMOS compiler) with cc and hope it will work without any hustle (because the entire code is still simple c, I guess?), but I'm getting lots of undefined references regards to float libraries. So, do I need to add some support compilation flags to support the library? Could anyone help me with this issue? Some error codes are mentioned down below: Errors:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello, I found one solution here on StackOverflow: |
Beta Was this translation helpful? Give feedback.
Hello, I found one solution here on StackOverflow:
https://stackoverflow.com/questions/8671366/undefined-reference-to-pow-and-floor
We must add the
-lm
flag after all the source code files.