在windows 上安装 qt

从这里 http://qt.nokia.com/downloads 下载你需要 的版本

我安装的是 :Qt SDK: Complete Development Environment

我安装是这个版本

安装完后,启动qt command prompt

"

Setting up a MinGW/Qt only environment..
-- QTDIR set to E:/Qt/2010.05/qt
-- PATH set to E:/Qt/2010.05/qt/bin
-- Adding E:/Qt/2010.05/bin to PATH
-- Adding C:/WINDOWS/System32 to PATH
-- QMAKESPEC set to win32-g++

"

但我想用vc编译, qmake -tp vc  结果

WARNING: Unable to generate output for: //Makefile.Debug [TEMPLATE vc]

原因出在这句 "QMAKESPEC set to win32-g++"

改为QMAKESPEC set to msvc-2008.

编译有错:

LINK : fatal error LNK1181: cannot open input file qtmaind.lib

 

解决方案:


Add this 2 paths to the Environment Variables: “C:/Qt/2009.01/bin” and “C:/Qt/2009.01/qt/bin”. Note: This path will depend where you install the Qt.

To add to the path: Control Panel > System > Advanced > Environment Variables

Select “PATH” under system variables. Click “EDIT” and Add this to the end of the line: C:/Qt/2009.01/bin; C:/Qt/2009.01/qt/bin (Remember to separate two paths with a “;”)
STEP 3: CONFIGURE QT FOR YOUR MACHINE

Run the Visual Studio Command prompt. Start > Program Files > Visual Studio > Visual Studio Tools > Visual Studio Command Prompt

Go to the path of your installed Qt e.g. cd C:/Qt/2009.01/qt

At the prompt type the command configure. E.g. C:/Qt/2009.01/qt> configure

This will configure Qt for your machine. In case you have multiple compilers installed, and want to build the Qt library using a specific compiler, you must specify a qmake specification. This is done by pasing -platform <spec> to configure. E.g. configure -platform win32-msvc
STEP 4: BUILDING QT FOR VISUAL STUDIO

Run nmake at the command prompt

This takes lots of time. Will build all the demos, examples and libraries.
That’s it QT is now installed. You can follow the tutorials to use Qt.

 

OK, it works.

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值