[En-Nut-Discussion] Unable to compile 'simple': circular references between libraries
Henrik Maier
hmlists at focus-sw.com
Fri Jan 27 23:21:40 CET 2006
Hi!
I had similar linker issues with various Nut/OS projects.
The gcc linker cannot resolve circular references between libraries.
Depending on the Nut/OS functions used in a project, I found one always
has to reorder libraries and add them multiple times.
I suggested in an earlier post to drop the concept of splitting Nut/OS
in separate libraries and just to have one library libnutosall.a.
Another option is to embed the libraries in start-group/end-group linker
options. gcc will then search the libraries multiple times to resolve
circular references between libraries. For example:
-Wl,--start-group -lnutpro -lnutos -lnutarch -lnutdev -lnutnet -lnutfs
-lnutcrt -Wl,--end-group
Henrik Maier
http://www.proconx.com
Lloyd Bailey wrote:
> Hi,
>
> I had the same problem, so I re-ordered the libraries (swopped nutdev
> and nutarch and add nutdev at the end.
>
> I hope this helps,
>
> Lloyd.
>
More information about the En-Nut-Discussion
mailing list