Help building hello_world needed

Sergio srg_j at yahoo.com
Tue Jul 17 03:37:02 UTC 2001


Hello
I'm using:
    binutils-2.9.1
    gcc-2.8.1
    gnat-3.12p
    newlib-1.8.2
    rtems-4.0.0

I'm trying to build ada_hello_world and I'm getting a "multiple definition of `main'" error:

  /root/rtems/install/ada/bin/i386-rtems-gnatmake -v -O -gnata -gnatE -gnato hello -g \
      -cargs -B/root/rtems/install/ada/rtems/pc386/lib/ -specs bsp_specs -qrtems -mcpu=i386 \
      -largs -B/root/rtems/install/ada/rtems/pc386/lib/ -specs bsp_specs -qrtems -mcpu=i386 init.o

  GNATMAKE 3.12p  (19990629) Copyright 1995-1999 Free Software Foundation, Inc.
    "hello.ali" being checked ...
    "hello" missing.
  i386-rtems-gnatbind -x hello.ali
  i386-rtems-gnatlink -g -B/root/rtems/install/ada/rtems/pc386/lib/ -specs bsp_specs -qrtems -mcpu=i386 init.o hello.ali
  i386-rtems-gcc: file path prefix `/root/rtems/install/ada/rtems/pc386/lib/' never used
  /root/rtems/install/ada/rtems/pc386/lib/librtemsall.a(startup.rel): In function `main':
  main.c:34: multiple definition of `main'
  b~hello.o:b~hello.adb:99: first defined here
  /root/rtems/install/ada/rtems/pc386/lib/librtemsall.a(startup.rel): In function `get_char':
  i386-stub.c:590: multiple definition of `get_char'
  /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':
  init.c:37: undefined reference to `gnat_main'
  /root/rtems/install/ada/lib/gcc-lib/i386-rtems/2.8.1/adalib/libgnat.a(a-init.o): In function `__gnat_initialize':
  a-init.c:1460: undefined reference to `__gnat_install_handler'
  /root/rtems/install/ada/i386-rtems/lib/libc.a(makebuf.o)(.text+0xc2):makebuf.c: undefined reference to `isatty'
  i386-rtems-gnatmake: *** link failed.
  make: *** [all] Error 4
What I'm doing wrong?
Thanks
    Sérgio.

PS: I'm using the following makefile:

  #
  #  Makefile for hello world example
  #

  MAIN=hello

  ## Tool paths
  tooldir=/root/rtems/install/ada
  rtemsdir=${tooldir}/rtems/pc386

  ## Tool names

  GCC=${tooldir}/bin/i386-rtems-gcc
  GNATMAKE=${tooldir}/bin/i386-rtems-gnatmake
  SIZE=${tooldir}/bin/i386-rtems-size

  CARGS=-B${rtemsdir}/lib/ -specs bsp_specs -qrtems -mcpu=i386

  all: init.o 
   $(GNATMAKE) -v -O -gnata -gnatE -gnato $(MAIN) -g \
       -cargs $(CARGS) \
       -largs $(CARGS) init.o
   $(SIZE) $(MAIN)

  init.o: init.c
   $(GCC) -O4 -g  -Wall -ansi -fasm $(CARGS) -c init.c

  run:
   @ echo Must run on the real target

  gdb:
   @ echo No real target

  clean:
   rm -f b_$(MAIN).c b_$(MAIN).o *.o *.ali $(MAIN)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20010717/a5ab9696/attachment.html>


More information about the users mailing list