I am on x86 trying to cross compile a apache thrift program written in C++ for armhf. I installed gcc-arm-linux-gnueabihf
and g++-arm-linux-gnueabihf
through apt-get
, but when I use them to compile my program, I get
skipping incompatible /usr/local/lib/libthrift.so when searching for -lthrift
so I tried configuring thrift to compile a armhf-compatible libthrift.so using this guide, so in bash:
./configure CXX=arm-linux-gnueabihf-g++ CC=arm-linux-gnueabihf-gcc --prefix=/BBB/thrift --host=arm-linux-gnueabihf --with-cpp CFLAGS="-g -O2 -I$DIR/include" LDFLAGS="-L$DIR/lib
but then I got:
checking for libevent >= 1.0... configure: error: in 'home/xic/thrift-0.9.0': configure: error: cannot run test program while cross compiling
so then I successfully compiled libevent, but it still wouldn't work. Looking into thrift's config.log
, I see
/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lfl
collect2: ld returned 1 exit status
so apparently I need to cross-compile flex as well. Is this really the best way of doing this, or are there any faster/easier ways?
ps. I am cross-compiling for the Beaglebone Black, which uses armhf