编译
Linux¶
以ubuntu为例。
找到release版本:https://github.com/gabime/spdlog/releases/tag/v1.9.2
sudo apt-get install cmake
wget https://github.com/gabime/spdlog/archive/refs/tags/v1.9.2.tar.gz
tar -zxvf v1.9.2.tar.gz
cd spdlog-1.9.2
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/home/cm/codes/Tools/3rdlib_linux/spdlog ..
make
sudo make install
问题:can not be used when making a shared object; recompile with -fPIC¶
spdlog/lib/libspdlog.a(spdlog.cpp.o): relocation R_X86_64_TPOFF32 against `_ZGVZN6spdlog7details2os9thread_idEvE3tid' can not be used when making a shared object; recompile with -fPIC
解决:cmake 添加 fpic参数