• 8309阅读
  • 2回复

Qt4.1.0编译时出错,why? [复制链接]

上一主题 下一主题
离线sidneychen
 
只看楼主 倒序阅读 楼主  发表于: 2006-03-21
我按照网站上的安装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

下面是编译时的窗口信息:

[root@sidneychen root]# qmake -o Makefile /root/qt-x11-opensource-src-4.1.0/qmak
e/examples/tutorial/hello.pro
[root@sidneychen root]# 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: *** [hello.o] Error 1


请教高手啊,请问是什么原因???
[ 此贴被XChinux在2006-03-21 12:58重新编辑 ]
在线XChinux

只看该作者 1楼 发表于: 2006-03-21
把程序帖出来看看
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线guostar
只看该作者 2楼 发表于: 2006-03-24
我的情况更糟,安装过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:

我的环境变量信息正确无误.为什么哪?
请高手指教!
快速回复
限100 字节
 
上一个 下一个