• 11981阅读
  • 2回复

【原创】用Eclipse(Version: 3.0.1)编译Qt的设置(qt-win-opensource-4.1.0-mingw.exe) [复制链接]

上一主题 下一主题
离线xuxinshao
 

只看楼主 倒序阅读 楼主  发表于: 2006-02-14
【原创】用Eclipse(Version: 3.0.1)编译Qt的设置(qt-win-opensource-4.1.0-mingw.exe)
— 本帖被 Bai_Jianping 执行取消置顶操作(2007-07-06) —
用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 <QtGui/QApplication>
#include <QtGui/QPushButton>

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
离线fanyu
只看该作者 1楼 发表于: 2006-02-14
对于复杂的qt程序来说,如带信号量、反应槽、ui文件等,用此方并不管用,因为它不能生成pro,进而生成新的makefile。使用日蚀最难的就在于使它的代码提示和自动完成生效,这个我弄了好久也没弄成。
离线vbgood

只看该作者 2楼 发表于: 2006-08-01
按照你的例子来出现下面这样的错误


**** Build of configuration Debug for project hello1 ****

make all
MAKE Version 5.2 Copyright (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
快速回复
限100 字节
 
上一个 下一个