【发布时间】:2013-08-05 06:01:36
【问题描述】:
我在 OpenSuse 12.3 上静态构建了 Log4cxx,但是当我尝试在我的 Qt 项目中构建它时,它在链接时失败。根据 apr、apr-util 和 log4cxx 的顺序,错误会有所不同,但是如果我使用此顺序 unix:!macx:LIBS+=-L$$ 构建,我认为这是一些最相关的链接错误LOG4CXX_PATH/lib -lapr-1 -laprutil-1 -llog4cxx:
../../../External/Linux/static/log4cxx/lib/liblog4cxx.a(objectptr.o): In function `log4cxx::helpers::ObjectPtrBase::exchange(void**, void*)':
objectptr.cpp:(.text+0x124): 未定义引用apr_atomic_xchg32'
../../../External/Linux/static/log4cxx/lib/liblog4cxx.a(stringhelper.o): In functionlog4cxx::helpers::StringHelper::toInt64(std::string const&)':
stringhelper.cpp:(.text+0x5d0): 对apr_atoi64'
../../../External/Linux/static/log4cxx/lib/liblog4cxx.a(pool.o): In functionlog4cxx::helpers::Pool::Pool()' 的未定义引用:
pool.cpp:(.text+0x3a): 对apr_pool_create_ex'
../../../External/Linux/static/log4cxx/lib/liblog4cxx.a(pool.o): In functionlog4cxx::helpers::Pool::~Pool()' 的未定义引用:
pool.cpp:(.text+0xfc): undefined reference to `apr_pool_destroy'
【问题讨论】:
标签: linux static linker log4cxx