g++: error: /usr/lib/x86_64-none/libboost_unit_test_framework.a: No such file or directory

62 Views Asked by At

I am trying to install Thrift-0.14.2 in Ubuntu 18.04 LTS.

step1: sudo apt-get install automake bison flex g++ git libboost-all-dev libevent-dev libssl-dev libtool make pkg-config

step2: vagrant@vagrant:/vagrant$ tar -xvzf thrift-0.14.2.tar.gz

step3: ./configure --host=x86_64 # ./configure will lead "configure: error: cannot run C compiled programs" error. I do not know why I need to add --host=x86_64 for cross compile

after step3, I met another several errors like error: ‘::malloc’ has not been declared # deleted AC_FUNC_MALLOC and AC_FUNC_REALLOC in ./thrift-0.14.2/configure.ac also, error "Unable to determine the behavior of a signed right shift" #added #define SIGNED_RIGHT_SHIFT_IS 1, #define ARITHMETIC_RIGHT_SHIFT 1 in ./lib/c_glib/src/thrift/config.h 和 ./lib/cpp/src/thrift/config.h.

step4: make # it shows "g++: error: /usr/lib/x86_64-none/libboost_unit_test_framework.a: No such file or directory".

In step4, I cannot search more information about this error, how to deal with that? Thanks

1

There are 1 best solutions below

0
danielsunck On

Solved! According to https://askubuntu.com/questions/360329/error-cannot-run-c-compiled-programs-if-you-meant-to-cross-compile-use-host, it is about the right of the shared folder in virtualbox. We need to copy the tar file to home/, then ./configure make make install maybe we should add sudo in front of these three commands. And it works well if you switch to vagrant folder to run thrift, because no matter what folders thrift complied in, it will be installed in Ubuntu.