<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2919.6307" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#0000ff face=Arial size=2><STRONG>Hello</STRONG></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><STRONG>I'm
using:</STRONG><BR> binutils-2.9.1<BR>
gcc-2.8.1<BR> gnat-3.12p<BR>
newlib-1.8.2</FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2>
rtems-4.0.0</FONT></DIV>
<DIV><BR><FONT color=#0000ff face=Arial size=2><STRONG>I'm trying to build
ada_hello_world and I'm getting a "multiple definition of `main'"
error:</STRONG></FONT></DIV>
<DIV> </DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV><FONT face=Arial size=2>/root/rtems/install/ada/bin/i386-rtems-gnatmake
-v -O -gnata -gnatE -gnato hello -g \<BR> -cargs
-B/root/rtems/install/ada/rtems/pc386/lib/ -specs bsp_specs -qrtems -mcpu=i386
\<BR> -largs -B/root/rtems/install/ada/rtems/pc386/lib/
-specs bsp_specs -qrtems -mcpu=i386 init.o</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>GNATMAKE 3.12p (19990629) Copyright
1995-1999 Free Software Foundation, Inc.<BR> "hello.ali" being checked
...<BR> "hello" missing.<BR>i386-rtems-gnatbind -x
hello.ali<BR>i386-rtems-gnatlink -g -B/root/rtems/install/ada/rtems/pc386/lib/
-specs bsp_specs -qrtems -mcpu=i386 init.o hello.ali<BR>i386-rtems-gcc: file
path prefix `/root/rtems/install/ada/rtems/pc386/lib/' never
used<BR>/root/rtems/install/ada/rtems/pc386/lib/librtemsall.a(startup.rel): In
function `main':<BR><STRONG>main.c:34: multiple definition of
`main'<BR>b~hello.o:b~hello.adb:99: first defined
here</STRONG><BR>/root/rtems/install/ada/rtems/pc386/lib/librtemsall.a(startup.rel):
In function `get_char':<BR>i386-stub.c:590: multiple definition of
`get_char'<BR>/root/rtems/install/ada/lib/gcc-lib/i386-rtems/2.8.1/adalib/libgnat.a(a-cio.o):a-cio.c:83:
first defined hereinit.o: In function `start_gnat_main':<BR>init.c:37:
undefined reference to
`gnat_main'<BR>/root/rtems/install/ada/lib/gcc-lib/i386-rtems/2.8.1/adalib/libgnat.a(a-init.o):
In function `__gnat_initialize':<BR>a-init.c:1460: undefined reference to
`__gnat_install_handler'<BR>/root/rtems/install/ada/i386-rtems/lib/libc.a(makebuf.o)(.text+0xc2):makebuf.c:
undefined reference to `isatty'<BR>i386-rtems-gnatmake: *** link
failed.<BR>make: *** [all] Error 4</FONT></DIV></BLOCKQUOTE>
<DIV><FONT color=#0000ff face=Arial size=2><STRONG>What I'm doing
wrong?<BR>Thanks</STRONG></FONT></DIV>
<DIV><FONT face=Arial size=2> <FONT
color=#0000ff><STRONG>Sérgio.</STRONG></FONT></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><STRONG>PS: I'm using the following
makefile:</STRONG></FONT></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV><BR><FONT face=Arial size=2>#<BR># Makefile for hello world
example<BR>#</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>MAIN=hello</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>## Tool
paths<BR>tooldir=/root/rtems/install/ada<BR>rtemsdir=${tooldir}/rtems/pc386</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>## Tool names</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial
size=2>GCC=${tooldir}/bin/i386-rtems-gcc<BR>GNATMAKE=${tooldir}/bin/i386-rtems-gnatmake<BR>SIZE=${tooldir}/bin/i386-rtems-size</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>CARGS=-B${rtemsdir}/lib/ -specs bsp_specs -qrtems
-mcpu=i386</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>all: init.o <BR> $(GNATMAKE) -v -O -gnata
-gnatE -gnato $(MAIN) -g \<BR> -cargs $(CARGS)
\<BR> -largs $(CARGS) init.o<BR> $(SIZE)
$(MAIN)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>init.o: init.c<BR> $(GCC) -O4 -g -Wall
-ansi -fasm $(CARGS) -c init.c</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>run:<BR> @ echo Must run on the real
target</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>gdb:<BR> @ echo No real target</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>clean:<BR> rm -f b_$(MAIN).c b_$(MAIN).o *.o
*.ali $(MAIN)<BR></FONT></DIV></BLOCKQUOTE></BODY></HTML>