首页| 论坛| 消息

标题:【原创】用Eclipse(Version: 3.0.1)编译Qt的设置(qt-win-opensource-4.1.0-mingw.exe)
作者:xuxinshao
日期:2006-02-14 20:43
内容:

用Eclipse(Version: 3.0.1)编译Qt的设置(qt-win-opensource-4.1.0-mingw.exe)
(1)安装Eclipse和CDT
(2)新建一个Managed Make C++ Project项目hello
(3)新增一个Source File main.cpp
#include
#include
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.resize(100, 30);
hello.show();
return app.exec();
}
(4)在Project/Properties中选择C/C++ Build下的Tool Settings选项卡进行设置:
GCC C++ Compiler/Directories中浏览添加C:\Qt\4.1.0\include
GCC C++ Linker/Libraries中Libraries(-l)中添加QtCored4,QtGuid4,qtmaind
(注意不能写成libQtGuid4.a,libQtGuid4.a,libqtmaind.a)
Library search path(-L)中浏览添加C:\Qt\4.1.0\lib
(5)Run


#1 [fanyu 02-14 21:32]
对于复杂的qt程序来说,如带信号量、反应槽、ui文件等,用此方并不管用,因为它不能生成pro,进而生成新的makefile。使用日蚀最难的就在于使它的代码提示和自动完成生效,这个我弄了好久也没弄成。
#2 [vbgood 08-01 18:41]
按照你的例子来出现下面这样的错误

**** Build of configuration Debug for project hello1 ****
make all
MAKE Version 5.2Copyright (c) 1987, 1998 Inprise Corp.
Error makefile 6: Command syntax error
Error makefile 11: Command syntax error
Error makefile 12: Command syntax error
Error makefile 13: Command syntax error
Error makefile 15: Command syntax error
Error makefile 16: Command syntax error
Error makefile 17: Command syntax error
Error makefile 18: Command syntax error
Error makefile 19: Command syntax error
Error makefile 20: Command syntax error
Error makefile 21: Command syntax error
Error makefile 22: Command syntax error
Error makefile 23: Command syntax error
Error makefile 24: Command syntax error
Error makefile 25: Command syntax error
Error makefile 26: Command syntax error
Error makefile 27: Command syntax error
Error makefile 28: Command syntax error
Error makefile 29: Command syntax error
Error makefile 30: Command syntax error
Error makefile 31: Command syntax error
Error makefile 32: Command syntax error
Error makefile 33: Command syntax error
Error makefile 34: Command syntax error
Error makefile 36: Command syntax error
Error makefile 57: Colon expected
Error makefile 59: Command syntax error
*** 27 errors during make ***
Build complete for project hello1

回复 发表
主题 版块