到USER32.LIB我需要的WINAPI函數SendInput從USER32.LIB我的應用程序,編譯器會抱怨未定義的引用「SendInput」。鏈接在QTCreator
因此,我試圖通過右鍵單擊在項目文件鏈接USER32.LIB,然後使用對話從Windows SDK加入我的文件。 Qt Creator中添加了以下行到我的.pro文件:
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../Program Files
(x86)/Microsoft SDKs/Windows/v7.0A/Lib/ -lUser32
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../Program Files
(x86)/Microsoft SDKs/Windows/v7.0A/Lib/ -lUser32d
else:symbian: LIBS += -lUser32
else:unix: LIBS += -L$$PWD/../../../Program Files (x86)/Microsoft SDKs/Windows
/v7.0A/Lib/ -lUser32
INCLUDEPATH += $$PWD/../../../Program Files (x86)/Microsoft SDKs/Windows/v7.0A
DEPENDPATH += $$PWD/../../../Program Files (x86)/Microsoft SDKs/Windows/v7.0A
不幸的是,雖然所有的路徑都在那裏,編譯器似乎忽略它。
我不斷收到「未定義參考SendInput」的錯誤。 感謝
的[添加外部庫到Qt可能重複。造物主項目(http://stackoverflow.com/questions/718447/adding-external-library-into-qt-creator-project) – 2012-01-17 19:39:30
我試過「LIBS + = -L $$報價(C:/ Program Files文件(86 )/微軟的SDK /窗/ v7.0A)-luser32" 在這裏發帖之前,讀線程 – jgpt 2012-01-17 19:57:36
把庫中的文件夾中沒有空間也似乎並沒有幫助。‘LIBS + = -LC:/ qt_applications -luser32’失敗 – jgpt 2012-01-17 21:49:00