我在将libqxt链接到Qt5应用程序时遇到了问题。
我编写的代码类似于文档中的示例,但我有错误。
QxtGlobalShortcut* shortcut = new QxtGlobalShortcut(this);
connect(shortcut, SIGNAL(activated()), this, SLOT(newScreenshoot()));
shortcut->setShortcut(QKeySequence("Ctrl+Shift+F12"));我使用的是QT5.0.1
damian@damian-Lenovo-B560:~$ qmake --version
QMake version 3.0
Using Qt version 5.0.1 in /usr/lib/i386-linux-gnu以及来自Ubuntu13.04存储库的最新的libqxt。
我有以下链接错误:
/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&)'发布于 2014-02-15 15:17:12
我现在在Ubuntu13.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库与qt4库的奇怪组合(libqxt似乎是用/forqt4编译的)。不幸的是,为了在Ubuntu上编译项目,我没有任何其他选项可以使用qt4。我不知道在规范会议上是否有什么问题。
希望这能省去一些麻烦,消除一些挫折。我惊讶地看到,几乎没有人抱怨这个问题。
https://stackoverflow.com/questions/16387479
复制相似问题