Troubleshoot arm-elf-gcc compiler

Status
Not open for further replies.

subdural

Junior Member level 1
Joined
Aug 21, 2004
Messages
19
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Location
Neutral Zone
Activity points
173
arm-elf-gcc hello world

Hi All,

I'm newbie. I need your expertise advice on troubleshooting arm-elf-gcc on cygwin.
a) I installed the cygwin setup (full installation)
b) I installed the gnuarm toochain v4.0.0 for cygwin (windows)

I wrote the simple C program (hello world) and compile the program on gcc at cygwin is succeded ant got out put "HELLO WORLD"

main()
{
printf ("Hello World!\n");
}



but when I compile using arm-elf-gcc compile on cygwin I got this message

$ arm-elf-gcc hello.c
hello.c: In function 'main':
hello.c:3: warning: incompatible implicit declaration of built-in function 'printf'

HOWEVER using gcc is successful
$ gcc hello.c

$ gcc hello.c -o hello.exe

$ hello.exe
Hello World!


Kindly please help me
thanks


[/img]
 

did u include the required inlude files ????

its will be better if u use a make file ..

try this makefile...

Sample Hello World Compile

# cat Makefile
CC = /opt/tools/bin/arm-elf-gcc

# this is the method that worked here
CFLAGS= -D__PIC__ --fpic -msingle-pic-base
LDFLAGS= -Wl,-elf2flt

# another method, I think I missed zFLAT executables on kernel
#CFLAGS=
#LDFLAGS= -Wl,-elf2flt=-z
# a third method I found
#CFLAGS = -O2 -pipe -Wall -g -fpic
#LDFLAGS = -Wl,-elf2flt

LIBS =
OBJS = hello.o

all: hello

hello: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o hello $(OBJS) $(LIBS)

clean:
rm -rf *.o *.elf *.gdb hello

# eof Makefile

# cat hello.c
#include
main(void){
printf("Hello world!\n");
exit(0);
}

put it on NFS and run it from unit

# ./hello
Hello world!
#




hope i helped u


helios
 

    subdural

    Points: 2
    Helpful Answer Positive Rating
simple hello world cygwin arm

u must use a make file


Sample Hello World Compile

# cat Makefile
CC = /opt/tools/bin/arm-elf-gcc

# this is the method that worked here
CFLAGS= -D__PIC__ --fpic -msingle-pic-base
LDFLAGS= -Wl,-elf2flt

# another method, I think I missed zFLAT executables on kernel
#CFLAGS=
#LDFLAGS= -Wl,-elf2flt=-z
# a third method I found
#CFLAGS = -O2 -pipe -Wall -g -fpic
#LDFLAGS = -Wl,-elf2flt

LIBS =
OBJS = hello.o

all: hello

hello: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o hello $(OBJS) $(LIBS)

clean:
rm -rf *.o *.elf *.gdb hello

# eof Makefile

# cat hello.c
#include
main(void){
printf("Hello world!\n");
exit(0);
}

put it on NFS and run it from unit

# ./hello
Hello world!
#



hope i helped u


helios
 

    subdural

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…