I am trying to cross-compile a C code which inserts some data within a mysql database. Actually I want to generate an ipk package file to install it over OpenWrt backfire which is installed over a board. During the cross-compile, I got a problem with mysqlclient library:
#######################################################################
root@mypc# make V=99
make[4]: Entering directory `/home/dawood/openwrt_9Jan2011/backfire/build_dir/target-mips_r2_uClibc-0.9.30.1/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/ish'
mips-openwrt-linux-uclibc-gcc -O2 -Wall -o ish ish.c ish_main.c
ish.c:1: note: someone does not honour COPTS correctly, passed 0 times
ish_main.c:1: note: someone does not honour COPTS correctly, passed 0 times
mips-openwrt-linux-uclibc-gcc -O2 -Wall -o ishd -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX ishd.c ish_main.c ish_open.c -Wl,-Bsymbolic-functions -rdynamic -L/usr/lib/mysql -lmysqlclient
cc1: warning: include location "/usr/include/mysql" is unsafe for cross-compilation
ishd.c:1: note: someone does not honour COPTS correctly, passed 0 times
cc1: warning: include location "/usr/include/mysql" is unsafe for cross-compilation
ish_main.c:1: note: someone does not honour COPTS correctly, passed 0 times
cc1: warning: include location "/usr/include/mysql" is unsafe for cross-compilation
ish_open.c:1: note: someone does not honour COPTS correctly, passed 0 times
/home/dawood/openwrt_9Jan2011/backfire/build_dir/target-mips_r2_uClibc-0.9.30.1/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/bin/ld: skipping incompatible /home/dawood/openwrt_9Jan2011/backfire/build_dir/target-mips_r2_uClibc-0.9.30.1/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/lib/libmysqlclient.so when searching for -lmysqlclient
/home/dawood/openwrt_9Jan2011/backfire/build_dir/target-mips_r2_uClibc-0.9.30.1/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make[4]: *** [cc1] Error 1
make[4]: Leaving directory `/home/dawood/openwrt_9Jan2011/backfire/build_dir/target-mips_r2_uClibc-0.9.30.1/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/ish'
make[3]: *** [/home/dawood/openwrt_9Jan2011/backfire/build_dir/target-mips_r2_uClibc-0.9.30.1/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/build_dir/target-mips_r2_uClibc-0.9.30.1/ish/.built] Error 2
make[3]: Leaving directory `/home/dawood/openwrt_9Jan2011/backfire/build_dir/target-mips_r2_uClibc-0.9.30.1/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/package/ish'
make[2]: *** [package/ish/compile] Error 2
make[2]: Leaving directory `/home/dawood/openwrt_9Jan2011/backfire/build_dir/target-mips_r2_uClibc-0.9.30.1/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1'
make[1]: *** [/home/dawood/openwrt_9Jan2011/backfire/build_dir/target-mips_r2_uClibc-0.9.30.1/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/target-mips_r2_uClibc-0.9.30.1/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/dawood/openwrt_9Jan2011/backfire/build_dir/target-mips_r2_uClibc-0.9.30.1/OpenWrt-SDK-ar71xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1'
make: *** [world] Error 2
##########################################################################
It seems that gcc linker is not able to find mysqlclient libraries, but I made some soft links in lib directory of OpenWrt-SDK-..., but nothing changed!!!
If anyone has been encounter formerly with such kind of errors, please let me know your experience.
Thanks,
Regards,
Dawood