This is the mail archive of the ecos-devel@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ECOS] Using C++ operator new and delete


Yes, you are right, I was using gcc and not cpp
compiler. However, now I renamed hello.c to hello.cpp,
compiled with g++ and now I have a lot of errors...I
used -mhard-float, then remove it, used -mfpu=fpa,
fpe, none worked.
Thank you for your patience. I am new using gnu
toolchain, but I learn :). Here is the output:


arm-elf-g++ -fno-builtin -mcpu=arm9tdmi -c -Wall -O
-ggdb -I. -Wall -nostdlib -Imc9328_install/include -O2
-ffunction-sections -fdata-sections -fno-rtti
-fno-exceptions -fvtable-gc -fno-schedule-insns
-fno-schedule-insns2 -D MONCOMPTR=0x10000038 -o
hello.o hello.cpp
cc1plus: warning: switch '-fvtable-gc' is no longer
supported
echo tools: arm-elf
tools: arm-elf
arm-elf-ld -o hello -Lmc9328_install/lib
-L/opt/ecos/gnutools/arm-elf/lib/gcc/arm-elf/4.1.1/
-L/opt/ecos/gnutools/arm-elf/arm-elf/lib hello.o
-Ttarget.ld -nostdlib
arm-elf-ld: ERROR: mc9328_install/lib/extras.o uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/extras.o
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(hal_common_hal_if.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(hal_common_hal_if.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(hal_common_hal_misc.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(hal_common_hal_misc.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(io_common_iosys.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(io_common_iosys.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(infra_startup.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(infra_startup.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(infra_prestart.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(infra_prestart.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(infra_pkgstart.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(infra_pkgstart.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(infra_userstart.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(infra_userstart.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(infra_diag.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(infra_diag.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(kernel_kapi.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(kernel_kapi.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(kernel_thread.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(kernel_thread.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(kernel_except.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(kernel_except.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(kernel_intr.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(kernel_intr.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(kernel_mlqueue.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(kernel_mlqueue.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(kernel_sched.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(kernel_sched.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(kernel_cnt_sem.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(kernel_cnt_sem.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(kernel_flag.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(kernel_flag.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(kernel_mbox.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(kernel_mbox.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(kernel_mutex.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(kernel_mutex.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_startup_mainthread.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_startup_mainthread.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_stdlib_rand.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_stdlib_rand.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(hal_arm_arch_hal_misc.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(hal_arm_arch_hal_misc.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(hal_arm_arch_context.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(hal_arm_arch_context.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(hal_arm_arm9_var_arm9_misc.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(hal_arm_arm9_var_arm9_misc.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(hal_arm_arm9_mc9328_mc9328_misc.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(hal_arm_arm9_mc9328_mc9328_misc.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(hal_arm_arm9_mc9328_kbd_drvr.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(hal_arm_arm9_mc9328_kbd_drvr.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(hal_arm_arm9_mc9328_mc9328mxl_gpio.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(hal_arm_arm9_mc9328_mc9328mxl_gpio.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(infra_memset.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(infra_memset.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(kernel_clock.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(kernel_clock.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_startup_invokemain.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_startup_invokemain.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_startup_exit.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_startup_exit.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_stdio_fflush.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_stdio_fflush.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_stdio_stdiofiles.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_stdio_stdiofiles.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_stdio_stream.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_stdio_stream.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_stdio_streambuf.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_stdio_streambuf.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(error_errno.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(error_errno.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(infra_memcpy.o) uses
hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file mc9328_install/lib/libtarget.a(infra_memcpy.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(services_memalloc_common_malloc.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(services_memalloc_common_malloc.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(services_memalloc_common_heaps.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(services_memalloc_common_heaps.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_startup__exit.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_startup__exit.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_startup_atexit.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_startup_atexit.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(services_memalloc_common_dlmalloc.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(services_memalloc_common_dlmalloc.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_startup_abort.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_startup_abort.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_stdio_fputc.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_stdio_fputc.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_stdio_fputs.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_stdio_fputs.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_stdio_fwrite.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_stdio_fwrite.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_string_memcmp.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_string_memcmp.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_string_strcat.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_string_strcat.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_string_strcmp.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_string_strcmp.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_string_strcpy.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_string_strcpy.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_string_strlen.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_string_strlen.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_string_strncmp.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_string_strncmp.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_string_strsuppt.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_string_strsuppt.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_signals_siginit.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_signals_siginit.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_stdio_stdout.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_stdio_stdout.o)
arm-elf-ld: ERROR:
mc9328_install/lib/libtarget.a(language_c_libc_stdio_stdiosupp.o)
uses hardware FP, whereas hello uses software FP
arm-elf-ld: failed to merge target specific data of
file
mc9328_install/lib/libtarget.a(language_c_libc_stdio_stdiosupp.o)
hello.o: In function `Led(int)':
/ecos-d/Products/eCos/hello.cpp:64: undefined
reference to `GPIO_clr(int)'
/ecos-d/Products/eCos/hello.cpp:66: undefined
reference to `GPIO_set(int)'
hello.o: In function `blinkleds()':
/ecos-d/Products/eCos/hello.cpp:51: undefined
reference to `GPIO_clr(int)'
/ecos-d/Products/eCos/hello.cpp:52: undefined
reference to `GPIO_set(int)'
/opt/ecos/gnutools/arm-elf/arm-elf/lib/libsupc++.a(vterminate.o):
In function
`__gnu_cxx::__verbose_terminate_handler()':
../../../../gcc-4.1.1/libstdc++-v3/libsupc++/vterminate.cc:89:
undefined reference to `_impure_ptr'
make: *** [hello] Error 1







--- Andrew Lunn <andrew@lunn.ch> wrote:

> On Tue, Nov 21, 2006 at 05:13:40AM -0800, David Luca
> wrote:
> > I attached a zip with the hello.c application, my
> > platform config file and makefile. This is the
> output:
> > 
> > arm-elf-gcc -fno-builtin -mcpu=arm9tdmi
> -mhard-float
> > -c -Wall -O -ggdb -I. -Wall
> >  -nostdlib -Imc9328_install/include -O2
> > -ffunction-sections -fdata-sections -fno
> > -rtti -fno-exceptions -fvtable-gc
> -fno-schedule-insns
> > -fno-schedule-insns2 -D MO
> > NCOMPTR=0x10000038 -o hello.o hello.c
> 
> new is a C++ function, but you are using the C
> compiler. This is not
> going to work. Look at the gcc documentation,
> section "3.2 Options
> Controlling the Kind of Output".
> 
>             Andrew
> 



 
____________________________________________________________________________________
Sponsored Link

Mortgage rates near 39yr lows. $510k for $1,698/mo. 
Calculate new payment! www.LowerMyBills.com/lre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]