2012-09-13 119 views
1

我不能編譯我的項目,該項目採用Pantheios(版本1.0.1-beta210)記錄在Qt Creator中(創作者2.5.2 + SDK 4.8.2編譯自源代碼與VS2008編譯器)與VS2008 C++編譯器。 但它適用於Visual Studio 2008!Pantheios Qt Creator中與VS C++ 2008編譯器編譯

  1. 首先,我編譯Pantheios庫,它應該使用VS命令行,然後使用路徑執行nmake pantheios_path\build\vc9\

  2. 然後我寫了使用VS2008使用Qt外接一個簡單的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 [email protected] 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 [email protected] 
    pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol [email protected] 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 [email protected] 
    pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol [email protected] 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 [email protected] 
    pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function _pantheios_onBailOut3 
    pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function _pantheios_onBailOut3 
    pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function _pantheios_onBailOut3 
    debug\Logging3.exe : fatal error LNK1120: 6 unresolved externals 
    

    順便說一句,在project.pro文件I設置:

    ... 
        INCLUDEPATH += $(STLSOFT)/include \ 
           $(PANTHEIOS_ROOT)/include 
    
        LIBS += -L$(PANTHEIOS_ROOT)/lib 
    ... 
    
  4. 而且我已經tryed改變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 [email protected] 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 [email protected] 
    pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol [email protected] 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 [email protected] 
    pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol [email protected] 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 [email protected] 
    pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function _pantheios_onBailOut3 
    pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function _pantheios_onBailOut3 
    pantheios.1.util.vc9.dll.debug.lib(util.bailout.dll.debug.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function _pantheios_onBailOut3 
    debug\Logging3.exe : fatal error LNK1120: 6 unresolved externals 
    

我也試過不同的combi國家之一:

LIBS += -L$(PANTHEIOS_ROOT)/lib -llibname_without_extension 

任何人都可以給我一個有用的建議嗎?也許有人在Qt Creator下使用Pantheios ...

回答

0

請在MSDN中搜索函數,然後就可以得到你錯過的庫。例如,以符號「_ 小鬼 _RegCloseKey @ 4」 ,請搜索‘RegCloseKey’在MSDN,你可以找到你錯過了‘Advapi32.lib’。然後,你要在你的.pro文件中添加該庫。

LIBS += -lAdvapi32