CentOS7 installation boost_1.80

CentOS7 encounters inexplicable problems when installing boost_1.80.

For the first time, install according to the following command. This is the command for installing 1.67 before. After installation, a dynamic link library .so and a static link .a file are generated. Write a program to compile and generate other dynamic link libraries .so, and link to the static library .a of boost is also no problem.

cd boost_1_80_0
./bootstrap.sh --with-libraries=all --with-toolset=gcc
./b2 cflags='-fPIC' cxxflags='-fPIC'
sudo ./b2 install

Later, some other libraries were installed on the system, such as mkl, armadillo, protobuf, sqlite, etc., and recompile boost_1.80 according to the above command again. The static library .a file is wrong, such as libboost_filesystem.a compared to the previous compiled version It became smaller, and the newly generated boost static library .a participated in linking to generate other dynamic libraries. I don't know which link affected the compilation environment, but I didn't go into it. Later, I found a solution, and there is no problem with the following compilation command.

cd boost_1_80_0
./bootstrap.sh --with-libraries=all --with-toolset=gcc
sudo ./b2 include=static,shared link=static link=shared cxxflags=-fPIC cflags=-fPIC install

Supongo que te gusta

Origin blog.csdn.net/bodybo/article/details/129369277
Recomendado
Clasificación