This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Problems linking multiple files
- From: Erant <erantimus at gmail dot com>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Mon, 1 Feb 2010 01:14:38 +0100
- Subject: [ECOS] Problems linking multiple files
I've recently been getting to know eCos, and have written a simple USB slave driver. In order to use this driver, I've also written a simple API to go with it. This API resides in a folder in my application folder, and consist of three separate C files. I've successfully built applications consisting of single C files, however multiple C files pose a problem.
When I attempt to link these C files into my main application, I run into a lot of 'multiple definitions' in the linking stage, all of the following form:
maxmux/platform.o: In function `atof':
/Users/tristan/Projects/devboard/src/ecos/app/../install/include/cyg/libc/stdlib/atox.inl:124: multiple definition of `atof'
main.o:/Users/tristan/Projects/devboard/src/ecos/app/../install/include/cyg/libc/stdlib/atox.inl:124: first defined here
The conflicts are between all three library files and my main.o file.
I've been using the following commandlines to attempt to build my project:
arm-eabi-gcc -c -v -g -I../install/include/ -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -O2 -DECOS -DECOS_USB main.c -std=c99 -o main.o
arm-eabi-gcc -c -v -g -I../install/include/ -O2 -DECOS -DECOS_USB maxmux/maxmux.c -std=c99 -o maxmux/maxmux.o
arm-eabi-gcc -c -v -g -I../install/include/ -O2 -DECOS -DECOS_USB maxmux/ring.c -std=c99 -o maxmux/ring.o
arm-eabi-gcc -c -v -g -I../install/include/ -O2 -DECOS -DECOS_USB maxmux/platform.c -std=c99 -o maxmux/platform.o
arm-eabi-gcc -g -v -I../install/include/ -L../install/lib -Wl,-static -nostdlib -DECOS -DECOS_USB main.o maxmux/maxmux.o maxmux/ring.o maxmux/platform.o -std=c99 -Ttarget.ld -o main.elf
Any help would be greatly appreciated,
-- Erant
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss