Problem with Building a simple program for ARM

OP (Company: ISC) #2547340
Rate this post
• ▲ useful
▼ not useful
Dear Friends
I'm beginner in ARM Projects development, and I wanted to start with run 
a simple "Hello world" on my OK6410 Board. My board processor is ARM 
1176jzf-s and have linux os.
I used Eclipse CDT and installed Sourcery_CodeBench_Lite_for_ARM_EABI on 
windows 7 platform and add GNU ARM Eclipse Plug-in.
my program:
#include "stdio.h"

int main(void) {
printf("Hello world !\n");
return 0;
}


When I wants to build my hello world project I get these errors:

cs-make all
'Building target: helloarm.elf'
'Invoking: ARM Sourcery Windows GCC C++ Linker'
arm-none-eabi-g++ -Wl,-Map,helloarm.map -mcpu=arm1176jzf-s -mthumb -g3 
-o "helloarm.elf"  ./src/helloarm.o
c:/program 
files/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/a 
rm-none-eabi/4.6.1/../../../../arm-none-eabi/bin/ld.exe:  warning: 
cannot find entry symbol _start; defaulting to 00008010
c:/program 
files/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/a 
rm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-abor 
t.o):  In function `abort':
abort.c:(.text+0xa): undefined reference to `_exit'
c:/program 
files/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/a 
rm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-fsta 
tr.o):  In function `_fstat_r':
fstatr.c:(.text+0xe): undefined reference to `_fstat'
c:/program 
files/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/a 
rm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-open 
r.o):  In function `_open_r':
openr.c:(.text+0x10): undefined reference to `_open'
c:/program 
files/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/a 
rm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-sbrk 
r.o):  In function `_sbrk_r':
sbrkr.c:(.text+0xc): undefined reference to `_sbrk'
c:/program 
files/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/a 
rm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-sign 
alr.o):  In function `_kill_r':
signalr.c:(.text+0xe): undefined reference to `_kill'
c:/program 
files/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/a 
rm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-sign 
alr.o):  In function `_getpid_r':
signalr.c:(.text+0x2e): undefined reference to `_getpid'
c:/program 
files/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/a 
rm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-writ 
er.o):  In function `_write_r':
writer.c:(.text+0x10): undefined reference to `_write'
c:/program 
files/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/a 
rm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-clos 
er.o):  In function `_close_r':
closer.c:(.text+0xc): undefined reference to `_close'
c:/program 
files/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/a 
rm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-isat 
tyr.o):  In function `_isatty_r':
isattyr.c:(.text+0xc): undefined reference to `_isatty'
c:/program 
files/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/a 
rm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-lsee 
kr.o):  In function `_lseek_r':
lseekr.c:(.text+0x10): undefined reference to `_lseek'
c:/program 
files/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/a 
rm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb\libc.a(lib_a-read 
r.o):  In function `_read_r':
readr.c:(.text+0x10): undefined reference to `_read'
collect2: ld returned 1 exit status
cs-make: *** [helloarm.elf] Error 1

**** Build Finished ****


Could you please help me find out the problem.
best regards
OP (Company: ISC) #2548484
Rate this post
• ▲ useful
▼ not useful
Thanks for feedback, based on your advices and link, I find out that I 
installed “arm-2011.09-69-arm-none-eabi.exe” and this version is for 
bare-metal devices and I think defining  "newlib stubs" is nessery for 
this kind of devices but my board has linux os then I installed 
“arm-2011.09-70-arm-none-linux-gnueabi.exe “ and the problem solved.

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.