【问题标题】:Linking static build of Log4cxx on linux fails to find symbols在 linux 上链接 Log4cxx 的静态构建无法找到符号
【发布时间】: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


    【解决方案1】:

    -lapr-1 -laprutil-1 -llog4cxx

    这个库的顺序是错误的。要了解原因,请阅读this

    【讨论】:

      猜你喜欢
      • 2017-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-03
      • 2021-04-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多