Hi! I have installed openwrt to my router(Xiaomi R3P Pro) . I want to build software using Google glog but I'm having some problem. I installed glog to my router using command opkg install glog
. I wrote code something like below and tried to build with my toolchain's g++(mipsel-openwrt-linux-g++).
#include <iostream>
#include <glog/logging.h>
int main(int argc, char *argv[])
{
google::InitGoogleLogging(argv[0]);
return 0;
}
But it fails to build and show error below.
/home/pol4bear/test/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.3.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.3.0/../../../../mipsel-openwrt-linux-musl/bin/ld: /tmp/ccnP9Rwu.o: in function `main':
main.cpp:(.text+0xb8): undefined reference to `google::InitGoogleLogging(char const*)'
I fixed this same problem by build library myself when I tried to use libpcap. But if I build glog using command below it succefully built.
./autogen.sh
CC=~/mi/mipsel-openwrt-linux-gcc ./configure --host=mipsel-openwrt-linux-musl --prefix=$HOME/glog
make
make install
But when I build using library I built my ld returns error below.
/home/pol4bear/test/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.3.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.3.0/../../../../mipsel-openwrt-linux-musl/bin/ld: skipping incompatible /home/pol4bear/test/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.3.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.3.0/../../../../mipsel-openwrt-linux-musl/lib/libglog.so when searching for -lglog
If I build library myself I can get static library libglog.a ether but compiler throws error that elf format are wrong.
Is there anything I can try else?