更新时间:2023-11-10 17:32:04
只需添加一行
#define BOOST_LOG_DYN_LINK 1
作为boosttest.cc
的第一行.
或者,您可以将 -DBOOST_LOG_DYN_LINK
添加到您的编译步骤(不是您在问题中发布的链接步骤):
Alternatively, you can add -DBOOST_LOG_DYN_LINK
to you compilation step (not the linking step, as you posted in the question):
g++ -std=c++11 -Wall -pedantic -g -O0 -DBOOST_LOG_DYN_LINK -c boosttest.cc
g++ boosttest.o -lpthread -lboost_log -o boosttest