I am afraid I seem to have another library related problem.
I can now compile a library, and link a .c file using it, successfully.
However at link time I get complaints of differing definitions.
Both the library and the .c file appear to be pointing to
C:\Applications\XMOS\11.11.1\target\include
for their .h files.
But I get error messages :
Code: Select all
**** Build of configuration Debug for project Add_aplc ****
xmake CONFIG=Debug all
"Updating eclipse config"
No modules used.
cd ./.build_Debug && xcc -target="XC-1A" -l aplc ..\.\.build_Debug\src\add.c.o ..\.\.build_Debug\src\Add_aplc.xc.o -o "..\bin\Debug\Add_aplc_Debug.xe"
../../../../../src/newlib/libc/syscalls/sysgettod.c: Error: Type of symbol gettimeofday has mismatch with previous definition:
../../../../../src/newlib/libc/syscalls/sysgettod.c: Error: found: signed int gettimeofday( struct timeval *, struct timezone * )
../src/runio.c: Error: previous: signed int gettimeofday( struct timeval {...} *, void * )
../../../../../src/newlib/libc/syscalls/sysfcntl.c: Error: Type of symbol fcntl has mismatch with previous definition:
../../../../../src/newlib/libc/syscalls/sysfcntl.c: Error: found: signed int fcntl( signed int, signed int, signed int )
../src/runio.c: Error: previous: signed int fcntl( signed int, signed int, ... )
../../../../../src/newlib/libc/syscalls/sysfcntl.c: Error: Type of symbol fcntl has mismatch with previous definition:
../../../../../src/newlib/libc/syscalls/sysfcntl.c: Error: found: signed int fcntl( signed int, signed int, signed int )
../src/runio_f.c: Error: previous: signed int fcntl( signed int, signed int, ... )
../../../../../src/newlib/libc/syscalls/sysstat.c: Error: Type of symbol stat has mismatch with previous definition:
../../../../../src/newlib/libc/syscalls/sysstat.c: Error: found: signed int stat( unsigned char *, struct stat * )
../src/runio_f.c: Error: previous: signed int stat( const unsigned char *, struct stat {...} * )
xmake[1]: *** [bin/Debug/Add_aplc_Debug.xe] Error 1
xmake: *** [bin/Debug/Add_aplc_Debug.xe] Error 2
When I try using xmake using the XMOS shell, it seems to ignore the Makefile in the current project - it does not link to the library.
Is there an example script that I can use to define the necessary cross-assembler definitions, so that I can use a cygwin shell ?
Or even better, a set of scripts I can add to a ./configure script to make it cross-compile to an XMOS device (the XC-1A) ?
[Edit]
I have re-built both the library and the add program, this time on the C partition, in case D: was causing problems. I have tried to do identical things for both, and have still ended up with miss-matched definitions.
The system includes for both purport to be :
Code: Select all
C:\Applications\XMOS\11.11.1\target\include
C:\Applications\XMOS\11.11.1\target\include\c++\4.2.1
C:\Applications\XMOS\11.11.1\target\include\c++\4.2.1\xcore-xmos-elf
C:\Applications\XMOS\11.11.1\target\include\gcc
include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.library
and the add make uses
-include $(XMOS_MAKE_PATH)/xcommon/module_xcommon/build/Makefile.common
Does anyone have any idea how to make both compiles use the same definitions ?
[Edit]
I have combined the add.c function with the library functions and still get the same problems when building ....
cheers,
Beau