I have OpenWRT RC4 on the new WRT54GL v4 router. I want to add customized C++ app onto the firmware (footprint size ~400KB)
I was able to compile all C++ src into obj files with a customized Makefile (using nmap sample) under the OpenWRT-SDK-Linux-i686-1's package dir that configures and calls another customized Makefile for my C++ app; but I get link errors.
I used mipsel-linux-uclibc-ar and mipsel-linux-uclibc-ranlib to create an archived library called "libofx.a" for easier linking and got the following errors:
/home/pbtran/LinkSys/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/bin/mipsel-linux-uclibc-g++ -o ofxdb ofx_db.cc -fPIC -g -O3 -Wall -Wno-deprecated -Os -pipe -mips32 -mtune=mips32 -funit-at-a-time -I. -I./ -I/home/pbtran/LinkSys/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/include -I/home/pbtran/LinkSys/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/include -nodefaultlibs -luClibc++ -lc -lm -lstdc++ -L. -L./ -L/home/pbtran/LinkSys/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/usr/lib -L/home/pbtran/LinkSys/OpenWrt-SDK-Linux-i686-1/staging_dir_mipsel/lib -lofx
./libofx.a(_ofxdb.o):/home/pbtran/LinkSys/OpenWrt-SDK-Linux-i686-1/package/ofx/fx-3.0/_ofxdb.cc:140: undefined reference to `log2'
./libofx.a(_index.o):/home/pbtran/LinkSys/OpenWrt-SDK-Linux-i686-1/package/ofx/fx-3.0/_index.cc:427: undefined reference to `ceilf'
./libofx.a(_index.o):/home/pbtran/LinkSys/OpenWrt-SDK-Linux-i686-1/package/ofx/fx-3.0/_index.cc:427: undefined reference to `floorf'
./libofx.a(_query.o):/home/pbtran/LinkSys/OpenWrt-SDK-Linux-i686-1/package/ofx/fx-3.0/_query.cc:430: undefined reference to `ceilf'
./libofx.a(_query.o):/home/pbtran/LinkSys/OpenWrt-SDK-Linux-i686-1/package/ofx/fx-3.0/_query.cc:431: undefined reference to `ceilf'
collect2: ld returned 1 exit status
make: *** [ofxdb] Error 1
The funny thing is that I see the references using "strings" command (and this compiles and links fine on Linux RH ES 4 and on MacOS 10.4) :
[pbtran@linux fx-3.0]$ strings libofx.a | grep -i log2
log2
[pbtran@linux fx-3.0]$ strings libofx.a | grep -i ceilf
ceilf