3
一個QT5應用程序鏈接libqxt我有一個QT5應用鏈接libqxt問題。在Ubuntu上
我在文檔中編寫了一個類似於示例中的代碼,但出現錯誤。
QxtGlobalShortcut* shortcut = new QxtGlobalShortcut(this);
connect(shortcut, SIGNAL(activated()), this, SLOT(newScreenshoot()));
shortcut->setShortcut(QKeySequence("Ctrl+Shift+F12"));
我使用Qt的5.0.1:
[email protected]:~$ qmake --version
QMake version 3.0
Using Qt version 5.0.1 in /usr/lib/i386-linux-gnu
和時尚libqxt-dev的從的Ubuntu 13.04庫。
我有以下鏈接錯誤:
/home/damian/Dokumenty/Programowanie/QShot/mainwindow.cpp:20: error: undefined reference to `QxtGlobalShortcut::QxtGlobalShortcut(QObject*)'
/home/damian/Dokumenty/Programowanie/QShot/mainwindow.cpp:22: error: undefined reference to `QxtGlobalShortcut::setShortcut(QKeySequence const&)'
看起來像你沒有*鏈接* libqxt。只包括庫的標題只是兩個步驟中的一個,鏈接它是第二步。然而,我不知道該怎麼做才能鏈接這個庫,也許看看文檔。 – leemes 2013-05-05 18:33:42
我已經添加到我的* .pro文件CONFIG + = qxt QXT + = core gui如文檔中所述。 – user2263192 2013-05-05 18:43:36
你能告訴我qmake輸出嗎?你是否也嘗試過與Qt4?也許qxt只與Qt4兼容(或者這個庫的特定版本是用Qt4構建的......) – leemes 2013-05-05 18:46:49