-
Notifications
You must be signed in to change notification settings - Fork 2
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
How to link stm8.lib? #2
Comments
This issue arises when you do arithmetic operations such as divisions or multiplications, as they rely on functions provided by the compiler. SDCC includes both platform-specific and portable implementations so |
Hey @XaviDCR92 many thanks for the clarification! I've compiled and linked However, following errors still exist. Do you mind telling me which files should I add? Thanks!
|
I am not sure what your |
Thanks for help! After some digging, I can reproduce the issue with below code. It looks like it is happending when doing arithmetic with float and int and then passing it to a function. .pio/build/default/src/main.o: In function `_main':
main:(.text._main+0x13): undefined reference to `_(float, short, short, bool __restrict)' #include "stm8s_adc1.h"
void test_function(uint16_t value) {}
void main(void)
{
uint16_t value = 1.0f - ADC1_GetConversionValue();
test_function(value);
} |
The error message is, for some reason, very unfortunate. Please add the following files to the build:
Adding them worked for me. |
Thanks! It finally working! It will be nice, If there is a precompiled version of stm8.lib provided for sdcc-gas 😄 |
If I'm not mistaken, the |
That will be great! It will be much easier for the linking. |
Thanks for the help! I will close this issue since it is actually solved. I created another issue XaviDCR92/stm8-binutils-gdb#1 to tracking the precompiled stm8.lib feature. |
Following error is raised when linking with
stm8-ld
. It looks likestm8.lib
is not linked. I tried with-L
and-l
options, butstm-ld
reports can not find library.The text was updated successfully, but these errors were encountered: