fopen with arm-elf-gcc

All design tool related questions: compiler, assembler, linker. Embedded programming questions: assembler, C code.

Moderator: nferre

indira
Posts: 8
Joined: Thu Feb 12, 2009 9:31 am

fopen with arm-elf-gcc

Sat Aug 22, 2009 12:57 pm

I am trying to read the sdcard which is not formatted by using AT92sam9rl64-ek_basic_SDCARD example program.

Reading the SDCARD is ok.After reading it, i want to write the data into a file in the root directory say "test.h" using fopen()& fprintf; it gives the error like below; what would be the probelm?
i believe it is library linking problem. can any one of you help me out?

or any other solution to read and make a copy of the SDCARD(not formatted)?

c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib\libg.a(lib_a-impure.o):(.data+0x0): multiple definition of `_impure_ptr'
obj/sdram_stdio.o:(.data+0x424): first defined here
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib\libg.a(lib_a-fopen.o): In function `_fopen_r':
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libc\stdio/../../../../../newlib-1.17.0/newlib/libc/stdio/fopen.c:141: undefined reference to `_open_r'
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib\libg.a(lib_a-fseek.o): In function `_fseek_r':
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libc\stdio/../../../../../newlib-1.17.0/newlib/libc/stdio/fseek.c:226: undefined reference to `_fstat_r'
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libc\stdio/../../../../../newlib-1.17.0/newlib/libc/stdio/fseek.c:258: undefined reference to `_fstat_r'
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib\libg.a(lib_a-makebuf.o): In function `__smakebuf_r':
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libc\stdio/../../../../../newlib-1.17.0/newlib/libc/stdio/makebuf.c:59: undefined reference to `_fstat_r'
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libc\stdio/../../../../../newlib-1.17.0/newlib/libc/stdio/makebuf.c:110: undefined reference to `_isatty_r'
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib\libg.a(lib_a-mallocr.o): In function `malloc_extend_top':
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libc\stdlib/../../../../../newlib-1.17.0/newlib/libc/stdlib/mallocr.c:2160: undefined reference to `_sbrk_r'
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libc\stdlib/../../../../../newlib-1.17.0/newlib/libc/stdlib/mallocr.c:2197: undefined reference to `_sbrk_r'
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib\libg.a(lib_a-stdio.o): In function `__sclose':
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libc\stdio/../../../../../newlib-1.17.0/newlib/libc/stdio/stdio.c:124: undefined reference to `_close_r'
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib\libg.a(lib_a-stdio.o): In function `__sseek':
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libc\stdio/../../../../../newlib-1.17.0/newlib/libc/stdio/stdio.c:106: undefined reference to `_lseek_r'
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib\libg.a(lib_a-stdio.o): In function `__swrite':
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libc\stdio/../../../../../newlib-1.17.0/newlib/libc/stdio/stdio.c:78: undefined reference to `_lseek_r'
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libc\stdio/../../../../../newlib-1.17.0/newlib/libc/stdio/stdio.c:86: undefined reference to `_write_r'
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib\libg.a(lib_a-stdio.o): In function `__sread':
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libc\stdio/../../../../../newlib-1.17.0/newlib/libc/stdio/stdio.c:48: undefined reference to `_read_r'
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib\libg.a(lib_a-freer.o): In function `_malloc_trim_r':
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libc\stdlib/../../../../../newlib-1.17.0/newlib/libc/stdlib/mallocr.c:3326: undefined reference to `_sbrk_r'
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libc\stdlib/../../../../../newlib-1.17.0/newlib/libc/stdlib/mallocr.c:3335: undefined reference to `_sbrk_r'
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libc\stdlib/../../../../../newlib-1.17.0/newlib/libc/stdlib/mallocr.c:3340: undefined reference to `_sbrk_r'
collect2: ld returned 1 exit status
make: *** [sdram] Error 1


thanks in advance
hemin

Return to “Development Tools”

Who is online

Users browsing this forum: No registered users and 1 guest