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

Problem compiling C++ with latest devboard & compiler



I'm sending this again as I don't think it got through.

I'm having trouble linking a basic c++ program containing a single class.
I believe the problem is because I am not linking in the correct libraries.
Any help
would be appreciated.

The output from make is:

gcc_cris -melinux -muclibc=/home/matthewh/axis/devboard_lx/eroot -s
-symbolic -L
/home/matthewh/axis/devboard_lx/eroot/lib  test.o -lucc -lic -lgcc -lstdc++
-o b
ridged
/home/matthewh/axis/devboard_lx/eroot/lib/uccrt0.o: In function `start1':
/home/matthewh/axis/devboard_lx/eroot/lib/uccrt0.o(.text+0x54): undefined
refere
nce to `main'
test.o(.text+0xa): undefined reference to `printf'
collect2: ld returned 1 exit status
make: *** [bridged] Error 1

This is the makefile:

USE_UCLIBC=1
include $(APPS)/Rules.elinux

DIRS = .
PROGS = test

SRCS = $(patsubst %, %/*.cpp, $(DIRS))
SRCS := $(wildcard $(SRCS))
OBJS = $(patsubst %.cpp, %.o, $(SRCS))

CXXFLAGS += -nostdinc -I$(prefix)/include/uC-libc -Wall
CXXFLAGS += -Dlinux
LDFLAGS += -L$(prefix)/lib
LDLIBS = -lucc -lic -lgcc -lstdc++

all: $(PROGS)

$(PROGS):  $(OBJS)
        $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@

clean:
        rm -f $(OBJS) *~ core

depend:
        makedepend -Y -- $(CFLAGS) -- $(SRCS) 2>/dev/null

Matt

CAUTION:  The information contained in this mail message is
confidential and may be legally privileged. No confidentiality
or privilege is waived or lost by any mistransmission. If the
reader of this message is not the intended recipient, you are
hereby notified that any use, dissemination, or reproduction of
this message is prohibited. If you have received this message in
error please notify the sender immediately by email and destroy
the original message. Thank you.