This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
RE: User libraries
- From: "Steven Clugston" <steven dot clugston at newcastle dot ac dot uk>
- To: <ecos-discuss at ecos dot sourceware dot org>
- Date: Thu, 17 Apr 2008 11:23:19 +0100
- Subject: RE: [ECOS] User libraries
>For my main application project, I set project references for
>everything I want to bring in, add directories -I and -L, and
>libraries -l for everything I need, including the eCos
>libraries. In the Misc section of the linker setting I added
>to following: -Wl,--cref -Wl,-Map,ProjectName.map -lc -lgcc
>-T target.ld -n
Now the fun begins with the link process.
Greg, I've looked through the ld man pages just to see what the flags
you use do, all looks good to me except the -lc and -lgcc.
Does this not try to include standard c and gcc libraries?
In any case, it complains that it can't find them when I include these
flags, so I've left them out.
Trouble I has was it is it is finding mutliple definitions of most of
the symbols when eclipse runs the linker on the app:
Invoking: GCC C++ Linker
powerpc-eabi-g++ -nostartfiles -nodefaultlibs -nostdlib
-L"/home/path_to_workspace/eCos_install/lib" -Wl,--gc-sections
-Wl,--cref -Wl,-Map,ProjectName.map -lgcc -Ttarget.ld -n -o"ProjectName"
./src/ProjectName.o -ltarget -lextras
/home/path_to_workspace/eCos_install/lib/extras.o: In function `R_t':
/home/path_to_workspace/eCos_install/lib/extras.o(.ecos.table.devtab.beg
in+0x0): multiple definition of `__DEVTAB__'
/home/path_to_workspace/eCos_install/lib/libextras.a(io_common_ioinit.o)
:/opt/ecos/packages/io/common/current/src/ioinit.cxx:73: first defined
here
/home/path_to_workspace/eCos_install/lib/extras.o: In function
`trigger':
/home/path_to_workspace/eCos_install/lib/extras.o(.ecos.table.mtab.extra
+0x0): multiple definition of `cyg_mtab_extra'
...and so on.
This turned out to be down to the link order, or rather the order in
which they are listed in the eclipse libraries (-l) dialog, libextras
needs to be before libtarget.
Seems to work now, or at least I end up with a binary, so thanks.
Steven.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss