firemail

标题: Qt Creator 增加日志模块 log4qt [打印本页]

作者: Qter    时间: 2018-2-24 11:56
标题: Qt Creator 增加日志模块 log4qt
本帖最后由 Qter 于 2018-2-24 12:28 编辑

右键 DoraemonSolution 新建子项目->Library->C++库



https://github.com/devbean/log4qt 下载源码
把源码拷贝到当前新建的工程下
修改工程文件QLoggingLib.pro 增加如下一行代码:
include(log4qt/log4qt.pri)
Doraemon中添加对日志的依赖
右键 Doraemon ->添加库-> 内部库


步后,将在Doraemon.pro文件添加如下代码
  1. win32:CONFIG(release, debug|release): LIBS += -L$OUT_PWD/../QLoggingLib/release/ -lQLoggingLib
  2. else:win32:CONFIG(debug, debug|release): LIBS += -L$OUT_PWD/../QLoggingLib/debug/ -lQLoggingLib
  3. else:unix: LIBS += -L$OUT_PWD/../QLoggingLib/ -lQLoggingLib

  4. INCLUDEPATH += $PWD/../QLoggingLib
  5. DEPENDPATH += $PWD/../QLoggingLib

  6. win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $OUT_PWD/../QLoggingLib/release/libQLoggingLib.a
复制代码

1.png (24.62 KB, 下载次数: 659)

1.png





欢迎光临 firemail (http://firemail.wang:8088/) Powered by Discuz! X3