zonyitoo / doubanfm-qt

A DoubanFM client
Other
511 stars 99 forks source link

编译错误:mainwidget.h:4:19: fatal error: QWidget: No such file or directory #11

Closed houqp closed 10 years ago

houqp commented 10 years ago

hi @zonyitoo ,

我在尝试编译的时候出现如下错误:

g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_MULTIMEDIA_LIB -DQT_DBUS_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtDBus -I/usr/include/qt4/QtMultimedia -I/usr/include/qt4 -I. -I. -o main.o main.cpp
In file included from main.cpp:1:0:
mainwidget.h:4:19: fatal error: QWidget: No such file or directory
compilation terminated.
make: *** [main.o] Error 1

系统ubuntu13.04,是开发包版本不兼容的原因么?

zonyitoo commented 10 years ago

要用Qt5编译,不要用Qt4

qmake-qt5 doubanfm-qt.pro

这样可以显式选择用Qt5

houqp commented 10 years ago

原来是这样,奇怪的是我这里没有qmake-qt5,只有qmake-qt4。最后我只能用qtchooser来运行:qtchooser -run-tool=qmake -qt=qt5

现在编译好了,谢谢。歌词功能很给力 :)