DanUnfortunately, I'm not using g++, yet at least. What I passed was an example of how to link libraries, in my case gcc libs. I'll try to get some time tomorrow to look into g++ lib linking.
Since I dont see any make output, when you compile I assume you are seeing the file mb-linux-g++ being used?
...Chris Dan Miller wrote:
Chris: You don't use CXXLIBS, you just use LDLIBS... ?? I don't understand...I scanned the entire petalinux file tree, and the only libstdc++.a that I found was:/home/petalinux-v0.40-rc3/tools/linux-i386/microblaze-uclinux-tools/microblaze-uclinux/lib/but if I try to add -L(that path) to CXX_LDFLAGS (which you don't use either), I get a bunch of other, meaningless errors.Did you install C++ libraries into this source tree yourself?? It almost looks it... I presume sofia-sip is your own project?Dan Dan Miller wrote: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:Danwhat 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 treeresponder: 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-uclinuxMailing 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/
___________________________ 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/