|Re: Generating .so library with C code. [message #1842426 is a reply to message #1842356]
||Fri, 18 June 2021 14:23
Registered: October 2012
The linker is saying it couldn't find libraries libgcc, libgcc_s and libc in the paths you've given.|
I'm not sure what extents would be used for them but likely .a or .so
but they may be different under windows.
C:\\build\\17.0\\x64\\sysroots\\core2-64-nilrt-linux\\usr\\include and the others would seem to be
directories containing header files and not libraries.
I would normally expect them in a path containing /usr/lib or similar
but since you are using a variant of gcc they could be elsewhere.
It's also saying it couldn't find modules crtio.o, crtbeginS.o, crtendS.o, and crtn.o
That means they are not in any library searched by the linker.
These are in the core C Run Time (CRT) library (or libraries)
Normally the linker (ld.exe) has the paths to CRT libraries built-in.
You may need to find them and supply the path using the -L and -l (small L) options.
But then these are used as startup/exit code run before and after the C main
which usually isn't in a dynamic library.
You can see what the default library paths are by adding -print-search-dirs to the link step.
BTW: Dynamic libraries may not be supported in your target environment.
They usually require OS support.
Can you really use them on your target?
If so, you need to pay attention to dynamic library requirements for your intended target.
If not, you may want to consider using/building static libraries.
[Updated on: Fri, 18 June 2021 14:40]
Report message to a moderator
Powered by FUDForum
. Page generated in 11.28908 seconds