簡體   English   中英

在Ubuntu上的Qt5應用程序中鏈接libqxt

[英]Linking libqxt in a Qt5 application on Ubuntu

我在Qt5應用程序中鏈接libqxt遇到問題。

我在文檔中編寫了一個代碼,但是我有錯誤。

QxtGlobalShortcut* shortcut = new QxtGlobalShortcut(this);
connect(shortcut, SIGNAL(activated()), this, SLOT(newScreenshoot()));
shortcut->setShortcut(QKeySequence("Ctrl+Shift+F12"));

我正在使用Qt 5.0.1

damian@damian-Lenovo-B560:~$ qmake --version
QMake version 3.0
Using Qt version 5.0.1 in /usr/lib/i386-linux-gnu

來自Ubuntu 13.04存儲庫的最新libqxt-dev

我有以下鏈接器錯誤:

/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&)'

我現在面臨着Ubuntu 13.10上的類似問題,我已經成功編譯了我的應用程序。 問題是我在添加記錄器引擎時收到的SIGSEGV

QxtBasicFileLoggerEngine *dbg  = new QxtBasicFileLoggerEngine("debug.log");

// qxtLog takes ownership of dbg - no need to manage its memory
qxtLog->addLoggerEngine("dbg", dbg);

為了做到這一點,我從命令行用QT4編譯了所有內容(不要使用qmake,它默認使用qt5):

qmake-qt4 
make

所以這似乎確實是qt5 libs與qt4 libs的奇怪組合(libqxt似乎用/為qt4編譯)。 不幸的是,我沒有任何其他選擇使用qt4來編譯Ubuntu上的項目。 我不知道在規范中是否存在問題。

希望這可以省去一些麻煩並消除一些挫敗感。 我很驚訝地看到幾乎沒有人抱怨這個問題。

暫無
暫無

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

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