March 29, 2024, 08:41:57 AM

OlimexODS liker error

Started by thevenindiasys, May 22, 2013, 11:37:51 AM

Previous topic - Next topic

thevenindiasys

There are already topics about this point, but no clear answer.

Linking a rather complex application (more than the blinking one), I get linker errors on
memcpy
memset
and other

These ones are easy to write by hand, but one day I will need sprintf, which is much more work.

Why does not the libgcca link correctly ?

Thanks


billr

I'm not a user of the OlimexODS toolchain, but I can tell you that those functions are not in libgcc.a, but rather in libc.a. Typically, libc is included automatically in the linking process, but you could try adding -lc to your linker command.

thevenindiasys

#2
Quote from: billr on May 22, 2013, 04:54:09 PM
I'm not a user of the OlimexODS toolchain, but I can tell you that those functions are not in libgcc.a, but rather in libc.a. Typically, libc is included automatically in the linking process, but you could try adding -lc to your linker command.

OK thank you for the correction, but I have also tried that, with no result.
Maybe a proble with the pathes. I will retry later.

....

I have tried it by adding the library libc.a with its full path in the linker line (the given makefile separates the link of the rest of the build, the reason is related to the thumb mode I have understood).
It works better for memcpy and others but not for sprintf which gives lots of errors like
undefined reference to `__aeabi_dcmpeq' and lots of functions __aeabi_...

I think the best is not to use sprintf (I have a light source code for it)...