• 8368阅读
  • 4回复

【提问】有朋友在freebsd下用qt编程么? [复制链接]

上一主题 下一主题
离线someone_dead
 

只看楼主 倒序阅读 楼主  发表于: 2005-11-02
— 本帖被 XChinux 从 Qt for Windows 移动到本区(2010-02-08) —
我现在用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的么?
能写个详细的配置过程么?
先谢谢了。
[ 此贴被XChinux在2005-11-03 09:08重新编辑 ]
离线XChinux

只看该作者 1楼 发表于: 2005-11-02
头文件找不到,你设置了QTDIR环境变量了没?把它设置为QT4的安装目录。
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线无心徘徊

只看该作者 2楼 发表于: 2005-12-21
我是在FreeBSD下编程的,我也是刚接触Qt,跟你 一样的错误,是头文件没有, 这是窗体以及控件的文件
技术是知识的积累,艺术是知识的熟练!
离线无心徘徊

只看该作者 3楼 发表于: 2005-12-23
对了,你需要用uic生成相应窗体,控件的头文件啊
技术是知识的积累,艺术是知识的熟练!
离线无心徘徊

只看该作者 4楼 发表于: 2005-12-23
终于搞明白了,
uic -o hello.h hello.ui, 用这个命令生成你的窗体的头文件, 然后再把这个文件包含在主程序里,然后:
qmake(在你的Qt的目录里)
qmake proname.prj
make
就可以了。
技术是知识的积累,艺术是知识的熟练!
快速回复
限100 字节
 
上一个 下一个