[arm-gnu] library linking (printf)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[arm-gnu] library linking (printf)



Hi,

I'm having trouble using C command "printf" in my code. The following error occurs:

C:\Program Files\CodeSourcery\Sourcery G++ Lite\arm-none-eabi\lib\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':

sbrkr.c:(.text+0x18): undefined reference to `_sbrk'

C:\Program Files\CodeSourcery\Sourcery G++ Lite\arm-none-eabi\lib\libc.a(lib_a-writer.o): In function `_write_r':

writer.c:(.text+0x20): undefined reference to `_write'

C:\Program Files\CodeSourcery\Sourcery G++ Lite\arm-none-eabi\lib\libc.a(lib_a-closer.o): In function `_close_r':

closer.c:(.text+0x18): undefined reference to `_close'

C:\Program Files\CodeSourcery\Sourcery G++ Lite\arm-none-eabi\lib\libc.a(lib_a-fstatr.o): In function `_fstat_r':

fstatr.c:(.text+0x1c): undefined reference to `_fstat'

C:\Program Files\CodeSourcery\Sourcery G++ Lite\arm-none-eabi\lib\libc.a(lib_a-isattyr.o): In function `_isatty_r':

isattyr.c:(.text+0x18): undefined reference to `_isatty'

C:\Program Files\CodeSourcery\Sourcery G++ Lite\arm-none-eabi\lib\libc.a(lib_a-lseekr.o): In function `_lseek_r':

lseekr.c:(.text+0x20): undefined reference to `_lseek'

C:\Program Files\CodeSourcery\Sourcery G++ Lite\arm-none-eabi\lib\libc.a(lib_a-readr.o): In function `_read_r':

readr.c:(.text+0x20): undefined reference to `_read'

collect2: ld returned 1 exit status

cs-make: *** [....elf] Error 1

I've followed the knowledgebase entry on this site about specifiying the target board, which I have done.
I also use my own linker script rather than the ones provided with CodeSourcery distribution.
The command option is "arm-none-eabi-gcc -lc -lgcc -lc" to try to do a multiple search.
Anyone have any suggestions?

Thanks,
AK


Arifa Khan
Embedded Software Engineer

T       +44 (0)1233 625252
F       +44 (0)1233 645897

arifa.khan@xxxxxxxxxxxxxxx



[cid:personal21547.jpg]



Ultratone Scientific Instruments Ltd., Kingsnorth Technology Park, Wotton Road, Ashford, Kent, TN23 6LN.
Company registration number 01321345

IMPORTANT NOTICE.
Confidentiality:  This e-mail and its attachments are intended for the above named only and may be confidential.  If they have come to you in error you must take no action based on them, nor must you copy or show them to anyone; please reply to this e-mail and highlight the error.
Security Warning:  Please note that this e-mail has been created in the knowledge that Internet e-mail is not a 100% secure communications medium.We advise that you understand and observe this lack of security when e-mailing us.
Viruses:  Although we have taken steps to ensure that this e-mail and attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free.
Monitoring and Scanning:  We have monitoring and scanning systems in place in relation to emails sent and received to: monitor / record business communications; prevent and detect crime; investigate the use of the Company's internal and external email system; and provide evidence of compliance with business practices.



JPEG image