首页| 论坛| 消息

标题:【提问】有朋友在freebsd下用qt编程么?
作者:someone_dead
日期:2005-11-02 19:33
内容:

我现在用freebsd6.0rc1.用ports安装了qmake ./usr/ports/devel/qmake
并设置了
#export QMAKESPEC=freebsd-g++
不过在编译hello.world 的时候显示如下错误.

$ pwd
/home/dead/qt/hello
$ qmake hello.pro
$ make
c++ -c -pipe -Wall -W -O2 -fno-strict-aliasing -pipe -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/local/share/qt/mkspecs/freebsd-g++ -I. -I. -I../../../../local/include -I/include -o main.o main.cpp
main.cpp:1:26: qapplication.h: No such file or directory
main.cpp:2:25: qpushbutton.h: No such file or directory
main.cpp: In function `int main(int, char**)':
main.cpp:7: error: `QApplication' undeclared (first use this function)
main.cpp:7: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:7: error: expected `;' before "a"
main.cpp:9: error: `QPushButton' undeclared (first use this function)
main.cpp:9: error: expected `;' before "hello"
main.cpp:10: error: `hello' undeclared (first use this function)
main.cpp:12: error: `a' undeclared (first use this function)
main.cpp: At global scope:
main.cpp:6: warning: unused parameter 'argc'
main.cpp:6: warning: unused parameter 'argv'
*** Error code 1
Stop in /usr/home/dead/qt/hello.
$
有朋友在 freebsd上用qt-designer的么?
能写个详细的配置过程么?
先谢谢了。


#1 [XChinux 11-02 22:32]
头文件找不到,你设置了QTDIR环境变量了没?把它设置为QT4的安装目录。
#2 [无心徘徊 12-21 14:22]
我是在FreeBSD下编程的,我也是刚接触Qt,跟你 一样的错误,是头文件没有, 这是窗体以及控件的文件
#3 [无心徘徊 12-23 11:00]
对了,你需要用uic生成相应窗体,控件的头文件啊
#4 [无心徘徊 12-23 11:32]
终于搞明白了,
uic -o hello.h hello.ui, 用这个命令生成你的窗体的头文件, 然后再把这个文件包含在主程序里,然后:
qmake(在你的Qt的目录里)
qmake proname.prj
make
就可以了。

回复 发表
主题 版块