【发布时间】:2012-09-13 12:16:55
【问题描述】:
我无法编译在 Qt Creator 中使用 Pantheios(版本 1.0.1-beta210)记录器的项目(已编译创建者 2.5.2 + SDK 4.8.2来自带有 VS2008 编译器的源代码)和 VS2008 C++ 编译器。 但它适用于 Visual Studio 2008!
首先,我编译了 Pantheios 库,因为它应该使用 VS 命令行和路径为
pantheios_path\build\vc9\的 nmake-
然后我用VS2008和Qt Addin编写了一个简单的Qt程序,它工作正常:
#include <pantheios/pantheios.hpp> #include <pantheios/inserters/args.hpp> #include <pantheios/backends/bec.WindowsConsole.h> #include <pantheios/implicit_link/core.h> #include <pantheios/implicit_link/fe.simple.h> #include <pantheios/implicit_link/be.WindowsConsole.h> #include <QApplication> #include "MainWindow.h" extern "C" const char PANTHEIOS_FE_PROCESS_IDENTITY[] = PANTHEIOS_LITERAL_STRING("play.with.logger"); int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); pantheios::log(pantheios::debug, "debug processing condition"); return a.exec(); } -
但是当我将它导出到 Qt Creator 项目时,它不想链接错误:
pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol __imp__RegCloseKey@4 referenced in function _pantheios_util_onBailOut_canUseWarnMessage_x_ pantheios.1.util.vc9.dll.debug.lib(util.time.dll.debug.obj) : error LNK2001: unresolved external symbol __imp__RegCloseKey@4 pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol __imp__RegQueryValueExA@24 referenced in function _pantheios_util_onBailOut_canUseWarnMessage_x_ pantheios.1.util.vc9.dll.debug.lib(util.time.dll.debug.obj) : error LNK2001: unresolved external symbol __imp__RegQueryValueExA@24 pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol __imp__RegOpenKeyA@12 referenced in function _pantheios_util_onBailOut_canUseWarnMessage_x_ pantheios.1.util.vc9.dll.debug.lib(util.time.dll.debug.obj) : error LNK2001: unresolved external symbol __imp__RegOpenKeyA@12 pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol __imp__DeregisterEventSource@4 referenced in function _pantheios_onBailOut3 pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol __imp__ReportEventA@36 referenced in function _pantheios_onBailOut3 pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol __imp__RegisterEventSourceA@8 referenced in function _pantheios_onBailOut3 debug\Logging3.exe : fatal error LNK1120: 6 unresolved externals顺便说一下,在我设置的
project.pro文件中:... INCLUDEPATH += $(STLSOFT)/include \ $(PANTHEIOS_ROOT)/include LIBS += -L$(PANTHEIOS_ROOT)/lib ... -
我还尝试通过以下方式更改 LIBS 变量:
LIBS += d:\workspaces\VS\pantheios-1.0.1-beta210_32\lib\pantheios.1.util.vc9.dll.debug.lib \ d:\workspaces\VS\pantheios-1.0.1-beta210_32\lib\pantheios.1.core.vc9.dll.debug.lib \ d:\workspaces\VS\pantheios-1.0.1-beta210_32\lib\pantheios.1.fe.simple.vc9.dll.debug.lib \ d:\workspaces\VS\pantheios-1.0.1-beta210_32\lib\pantheios.1.bec.WindowsConsole.vc9.dll.debug.lib \ d:\workspaces\VS\pantheios-1.0.1-beta210_32\lib\pantheios.1.be.WindowsConsole.vc9.dll.debug.lib得到这个:
pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol __imp__RegCloseKey@4 referenced in function _pantheios_util_onBailOut_canUseWarnMessage_x_ pantheios.1.util.vc9.dll.debug.lib(util.time.dll.debug.obj) : error LNK2001: unresolved external symbol __imp__RegCloseKey@4 pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol __imp__RegQueryValueExA@24 referenced in function _pantheios_util_onBailOut_canUseWarnMessage_x_ pantheios.1.util.vc9.dll.debug.lib(util.time.dll.debug.obj) : error LNK2001: unresolved external symbol __imp__RegQueryValueExA@24 pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol __imp__RegOpenKeyA@12 referenced in function _pantheios_util_onBailOut_canUseWarnMessage_x_ pantheios.1.util.vc9.dll.debug.lib(util.time.dll.debug.obj) : error LNK2001: unresolved external symbol __imp__RegOpenKeyA@12 pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol __imp__DeregisterEventSource@4 referenced in function _pantheios_onBailOut3 pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol __imp__ReportEventA@36 referenced in function _pantheios_onBailOut3 pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol __imp__RegisterEventSourceA@8 referenced in function _pantheios_onBailOut3 debug\Logging3.exe : fatal error LNK1120: 6 unresolved externals
我也尝试了不同的组合:
LIBS += -L$(PANTHEIOS_ROOT)/lib -llibname_without_extension
谁能给我一个有用的建议?也许有人在 Qt Creator 下使用 Pantheios...
【问题讨论】:
标签: c++ qt visual-studio-2008 qt-creator pantheios