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

Re: [microblaze-uclinux] building C++ apps (reprise)



Well, here's the chain of instructions which builds the various macros; I guess the answer is, it doesn't look a -L argument is being generated at all!!  At least, it isn't present in the link/compile command below.

I wonder if I need something like LIBCXXDIR, to replace the LIBCDIR below?  Unfortunately, I don't have anything to use for reference *except* the cxxtest directories, and all of those build native apps, not mb apps, when I run make...  Clearly, I'm still missing one or more steps in converting the default C Makefile to a CPP makefile.

Dan

# Point to default PetaLinux root directory
ifndef ROOTDIR
ROOTDIR=$(PETALINUX)/software/petalinux-dist
endif

PATH:=$(PATH):$(ROOTDIR)/tools

UCLINUX_BUILD_USER = 1
-include $(ROOTDIR)/.config
-include $(ROOTDIR)/$(CONFIG_LINUXDIR)/.config
LIBCDIR = $(CONFIG_LIBCDIR)
-include $(ROOTDIR)/config.arch
ROMFSDIR=$(ROOTDIR)/romfs
ROMFSINST=$(ROOTDIR)/tools/romfs-inst.sh

APP = ulocate

# Add any other object files to this list below
APP_OBJS = ulocate.o

all: $(APP)

$(APP): $(APP_OBJS)
    $(CXX) $(CXX_LDFLAGS) -o $@ $(APP_OBJS) $(CXXLIBS)


Chris Robson wrote:

Dan

what does your "-L" statement look like?  Here is an example of my app, built within the ./petalinux-dist/user tree, but the "-L'" statement should be similar (of course the tree would be diff).

can you capture the make output?

My test Makefile within ./petalinux-dist/user/responder tree

responder: responder.c handlers.o Makefile common.h config.o hash.o inflight.o
   $(CC) -g -Wall -I/usr/include -o responder \
   -L $(ROOTDIR)/lib/sofia-sip/build/libsofia-sip-ua/.libs \
   inflight.o handlers.o hash.o config.o responder.c \
   $(LDLIBS) -lsofia-sip-ua -lpthread



Dan Miller wrote:
Okay, as far as I can tell, I'm doing this correctly; please update if I am not:

1. Create a new app using petalinux-new-app
2. copy my source file into the resulting directory.
    Unlike the default appname.c, my file is appname.cpp
3. In the Makefile:
    app build: change all
         CC => CXX,
         LDFLAGS => CXX_LDFLAGS
         LDLIBS => CXXLIBS

    add new rule for %.cpp, change:
         CC => CXX
         CFLAGS => CXXFLAGS

All this is based on user/cxxtest/helloworld/Makefile

But, when I build, the file-compile is successful, but link fails:
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

//*****************************************************
So, what am I doing wrong?

Dan Miller


___________________________ 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/
___________________________
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/



___________________________ 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/