簡體   English   中英

Qt Creator中的Pantheios與VS C ++ 2008編譯器

[英]Pantheios in Qt creator with VS C++ 2008 compiler

我無法在VS2008 C ++編譯器中使用Qt Creator (使用VS2008編譯器從源代碼編譯的創建器2.5.2 + SDK 4.8.2)中使用Pantheios (版本1.0.1-beta210)記錄器的項目進行編譯 但是它可以在Visual Studio 2008中使用!

  1. 首先,我已經編譯了Pantheios庫,因為它應該使用VS命令行並使用路徑pantheios_path\\build\\vc9\\ nmake pantheios_path\\build\\vc9\\

  2. 然后我使用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(); } 
  3. 但是,當我將其導出到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 ... 
  4. 我也嘗試通過以下方式更改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 ...

請在MSDN中搜索功能,然后可以獲得丟失的庫。 例如,在符號“ _ imp _RegCloseKey @ 4”中,請在MSDN中搜索“ RegCloseKey”,會發現您錯過了“ Advapi32.lib”,然后應將此庫添加到.pro文件中。

LIBS += -lAdvapi32

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM