I am new to this forum and for introduction I have this problem
I've been fighting with this for a few days and now I feel like giving it up.. But.. I think I really need someone's help.
I'm trying to cross-compile a command-line utility for ARM architecture.
I have this makefile:
(If somebody is interested in Rules.mak, I can also post it).Code:PROGRAMS = apb_util_cmd INSTALL_TO_SBIN = $(PROGRAMS) include ../Rules.mak DIR = /opt/SiSP-L26.7.4-OpenWrt-2.0/staging_dir/toolchain-arm_gcc-4.3.4_glibc-2.6.1/usr/bin/ #DIR = /home/zajic/mindspeed/SiSP-L26.7.4-OpenWrt-2.0/staging_dir/toolchain-arm_gcc-4.3.4_glibc-2.6.1/usr/bin/ CC = arm-openwrt-linux-gcc CFLAGS = -msoft-float -O -pedantic -Wall -I/home/zajic/mindspeed/SiSP-L26.7.4-OpenWrt-2.0/build_dir/linux-c300evm/kernel-linux_22.214.171.124-4.05.1 LDFLAGS = -msoft-float -ldl LIBS = -lm apb_util_cmd: libapbcs.o libapbcore.o apb_util_cmd.o libmsp.o libmsp-elf.o libmsp-aif.o $(DIR)$(CC) $(LDFLAGS) -o apb_util_cmd apb_util_cmd.o libapbcs.o libapbcore.o libmsp.o libmsp-elf.o libmsp-aif.o $(LIBS) $(LDLIBS) libapbcs.o: libapbcs.c libapbcore.o: libapbcore.c apb_util_cmd.o: apb_util_cmd.c #libmsp-coredump.o: libmsp-coredump.c libmsp.o: libmsp.c libmsp-elf.o: libmsp-elf.c libmsp-aif.o: libmsp-aif.c
When I try to run "make apb_util_cmd", I get for example this errors(and others of this kind):
libapbcs.o: In function `msp_my_read':
libapbcs.c.text+0x1d0): undefined reference to `coredump_new'
libapbcs.c.text+0x24c): undefined reference to `coredump_open'
libapbcs.c.text+0x2b4): undefined reference to `coredump_write'
libapbcs.c.text+0x2f0): undefined reference to `coredump_close'
libapbcs.c.text+0x41c): undefined reference to `coredump_free'
libapbcs.c.text+0x42c): undefined reference to `coredump_close'
libapbcs.c.text+0x43c): undefined reference to `coredump_free'
I have checked that after running "make clean" all object files dissappear (how surprising ) and after "make" there are all the neccessary *.o files listed in the directory, but they somehow does not link. Maybe I forgot something, but I really do not know what.
The functions coredump_new, coredump_free, etc. are defined in libapbcore.c and are mentioned in libapbcore.h, which is then included by libapbcs.c.
This is a project that I copied from a colleague and I did some changes in code, moved functions to proper libs and renamed some libs to get more logic structure of the project.. Anyway, I think the code is not important so much.
I am almost new to linux makefiles, so I would search the problem here...
Thank you very much for help