您的位置:首页 > 编程语言 > Qt开发

在windows 上安装 qt

2010-12-23 22:31 281 查看

从这里 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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: