[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] user-app: "undefined reference to 'operator new[] (unsigned long)" ??



John Williams wrote:
On Wed, Jun 10, 2009 at 4:39 AM, Dan Miller <dan@xxxxxxxxxx> wrote:
  
I'm starting out with a simple one-file c++ utility.  I created a project
using petalinux-new-app, then replaced ulocate.c with my existing
ulocate.cpp.  The only change I made to Makefile is

CC=g++
    

No, g++ is your host compiler.  You need the cross compiler.

Check petalinux-dist/user-apps/cxxtest for sample Makefiles to
cross-compile C++ programs.

Regards,

John
  
Okay, I copied all the compile/link commands (using CXX, CXXFLAGS, CXX_LDFLAGS, CXXLIBS),  from cxxtest/helloworld Makefile to mine and attempted to build my application again, and it still fails with:

root@damien:/home/petalinux-v0.40-rc3/software/user-apps/ulocate# make clean all
rm -f ulocate *.elf *.gdb *.o
mb-linux-g++  -c -Os -g -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall  -mno-xl-soft-div -mxl-barrel-shift -mcpu=v7.20.a -mxl-multiply-high -mno-xl-soft-mul -mhard-float  -DEMBED -I/home/petalinux-v0.40-rc3/software/petalinux-dist -I/home/petalinux-v0.40-rc3/software/petalinux-dist/include -I/home/petalinux-v0.40-rc3/software/petalinux-dist/include -Dlinux -D__linux__ -Dunix -DLINUX  -o ulocate.o ulocate.cpp
mb-linux-g++   -o ulocate ulocate.o -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
/home/petalinux-v0.40-rc3/tools/linux-i386/microblaze-glibc-root/bin/../lib/gcc/microblaze-linux-elf/4.1.1/../../../../microblaze-linux-elf/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** [ulocate] Error 1

Dan


___________________________ microblaze-uclinux mailing list microblaze-uclinux@xxxxxxxxxxxxxx Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/