标题:Qt4.1.0编译时出错,why?
作者:sidneychen
日期:2006-03-21 12:06
内容:
我按照网站上的安装QT4。1。0的帖子,把QT安装成功后。
编译一个例子程序,却出现了找不到该函数的错误。
环境变量信息:
PATH=/usr/local/Trolltech/Qt-4.1.0/bin:$PATH
export PATH
QTDIR=/usr/local/Trolltech/Qt-4.1.0
export QTDIR
下面是编译时的窗口信息:
# qmake -o Makefile /root/qt-x11-opensource-src-4.1.0/qmak
e/examples/tutorial/hello.pro
# make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB
-DQT_SHARED -I/usr/local/Trolltech/Qt-4.1.0/mkspecs/linux-g++ -Iqt-x11-opensourc
e-src-4.1.0/qmake/examples/tutorial -I/usr/local/Trolltech/Qt-4.1.0/include/QtCo
re -I/usr/local/Trolltech/Qt-4.1.0/include/QtGui -I/usr/local/Trolltech/Qt-4.1.0
/include -Iqt-x11-opensource-src-4.1.0/qmake/examples/tutorial -Iqt-x11-opensour
ce-src-4.1.0/qmake/examples/tutorial -I. -o hello.o qt-x11-opensource-src-4.1.0/
qmake/examples/tutorial/hello.cpp
qt-x11-opensource-src-4.1.0/qmake/examples/tutorial/hello.cpp: In constructor
`MyPushButton::MyPushButton(const QString&)':
qt-x11-opensource-src-4.1.0/qmake/examples/tutorial/hello.cpp:5: no matching
function for call to `QPushButton::QPushButton(const QString&, int, const
char[13])'
/usr/local/Trolltech/Qt-4.1.0/include/QtGui/qpushbutton.h:87: candidates are:
QPushButton::QPushButton(const QPushButton&)
/usr/local/Trolltech/Qt-4.1.0/include/QtGui/qpushbutton.h:45:
QPushButton::QPushButton(const QIcon&, const QString&, QWidget* = 0)
/usr/local/Trolltech/Qt-4.1.0/include/QtGui/qpushbutton.h:44:
QPushButton::QPushButton(const QString&, QWidget* = 0)
/usr/local/Trolltech/Qt-4.1.0/include/QtGui/qpushbutton.h:43:
QPushButton::QPushButton(QWidget* = 0)
make: *** Error 1
请教高手啊,请问是什么原因???
#1 [XChinux 03-21 12:58]
把程序帖出来看看
#2 [guostar 03-24 10:37]
我的情况更糟,安装过4.1后,连makefile都生成不了,到qt安装目录的例程中编译,问题同样.
生成makefile时的提示为:
/usr/local/Trolltech/Qt-4.1.0-rc1/mkspecs/features/qt_config.prf:8: Unknown test function: debug
Error processing project file:
我的环境变量信息正确无误.为什么哪?
请高手指教!