【问题标题】:compile Qt with qmake and make用 qmake 编译 Qt 和 make
【发布时间】:2013-07-18 07:39:35
【问题描述】:

我需要有关使用 cmd 编译 Qt 文件的帮助。我选择了目录,但仍然有关于“qmake”和“make”命令的错误。

我不能 qmake 或 make .我正在显示 cmd 目录。但我无法编译它。我需要使用哪个目录???


C:\Users\foo>dir
 Volume in drive C has no label.
 Volume Serial Number is F224-008C

 Directory of C:\Users\foo

18.07.2013  09:42    <DIR>          .
18.07.2013  09:42    <DIR>          ..
17.07.2013  12:27    <DIR>          ipch
17.07.2013  16:41    <DIR>          QtTab
18.07.2013  09:42        21.450.752 QtTab.sdf
11.07.2013  11:17               882 QtTab.sln
11.07.2013  11:22    <DIR>          Win32
               2 File(s)     21.451.634 bytes
               5 Dir(s)  103.678.271.488 bytes free

C:\Users\foo>qmake
'qmake' is not recognized as an internal or external command,
operable program or batch file.


C:\Users\foo>make
'make' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\foo>cd qttab

C:\Users\foo>dir
 Volume in drive C has no label.
 Volume Serial Number is F224-008C

 Directory of C:\Users\foo

17.07.2013  16:41    <DIR>          .
17.07.2013  16:41    <DIR>          ..
17.07.2013  16:42    <DIR>          Debug
17.07.2013  16:41    <DIR>          GeneratedFiles
17.07.2013  16:41               308 main.cpp
11.07.2013  11:17               130 qttab.cpp
11.07.2013  11:17               254 qttab.h
11.07.2013  11:17                65 qttab.qrc
17.07.2013  16:41             1.353 qttab.ui
11.07.2013  11:17            10.830 QtTab.vcxproj
11.07.2013  11:17             2.659 QtTab.vcxproj.filters
11.07.2013  11:22               609 QtTab.vcxproj.user
11.07.2013  11:17    <DIR>          Resources
17.07.2013  12:28             1.994 foo.ui
               9 File(s)         18.202 bytes
               5 Dir(s)  103.678.271.488 bytes free

C:\Users\foo>qmake
'qmake' is not recognized as an internal or external command,
operable program or batch file.

【问题讨论】:

    标签: qt cmd makefile qmake


    【解决方案1】:

    由于您使用的是 windows,因此您似乎应该使用 nmake,而不是 make - 请参阅

    qt documentation on compilation under windows

    【讨论】:

    • 你需要打开一个VS控制台(在开始菜单中)/source vcallvars.bat(或者类似的,不记得确切的名字)并添加Qt的bin/dir(那个qmake.exe驻留在) 路径。
    【解决方案2】:

    扩展您的PATH 系统变量以包含 QT-InstallationDir/bin(这是 qmake 所在的位置)并在开始编译之前在您的 cmd 中运行您的 MSVC2010 安装目录中的vcvars.bat 文件(或者使用 cmd 快捷方式在 MSVC 文件夹中的开始菜单中提供)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-02-07
      • 1970-01-01
      • 2011-02-28
      • 1970-01-01
      • 2010-11-25
      • 1970-01-01
      • 2013-12-19
      • 2012-03-10
      相关资源
      最近更新 更多