nmake odbc 文件时 Qt 命令错误
Qt command error when nmake the odbc files
我是 C++ 和 Qt 的新手。
最近在用MS学习QtSQl,但是在编译odbc文件的时候遇到了问题
首先我 运行 qmake 并且一切顺利。但是当我使用nmake
时,出现了以下错误:
module machine type 'x64' conflicts with target machine type 'x86'
我今天刚遇到类似的问题。
和你一样,
I tried almost all comand tools include the one in qt, vs2015 x86,x64
command prompt, and cross tools as well. But none of them works.
我通过以下方式解决了问题:
- 完全删除了整个项目及其文件夹。
- 重新创建项目。
- 确保
%PATH%
变量,除了不相关的路径,包含仅 正确的 Qt build 路径。在我的例子中 %PATH%
包含 'C:\Qt.5\msvc2013_64\bin'
。 正确 我的意思是,当然,Qt 构建是使用我试图编译的相同编译器构建的。
- 那我运行
VS2013 x64 Native Tools Command Prompt
.
- 切换到项目文件夹。
- 然后我做了
qmake
然后 nmake
一切都很好。
我认为问题在于,正如drescherjm建议的那样,
If you tried one time with the wrong command prompt then tried again on the same build folder you build folder would have been broken by the bad try.
因此,
You will have to clean build between tries.
感谢drescherjm and Herman Nurlygayanov,问题终于解决了
以下是我从这个问题中得到的一些经验:
- Qt creator 的版本是 32 位 还是 64 位 应该在所有这些东西之前通过检查
About Qt creator
。编译前选择正确版本的命令提示符很重要。
- 此外,如果使用32位命令提示符,则应执行
vcvars32.bat
。至于64-bit版本,应该执行vcvarsall.bat
。它们分别位于 %dir of you vs%/vc
和 %dir of you vs/vc/bin
。
- 如果在一次编译过程中发生任何错误,则必须在下一次尝试中执行另一个
qmake
。
我是 C++ 和 Qt 的新手。
最近在用MS学习QtSQl,但是在编译odbc文件的时候遇到了问题
首先我 运行 qmake 并且一切顺利。但是当我使用nmake
时,出现了以下错误:
module machine type 'x64' conflicts with target machine type 'x86'
我今天刚遇到类似的问题。
和你一样,
I tried almost all comand tools include the one in qt, vs2015 x86,x64 command prompt, and cross tools as well. But none of them works.
我通过以下方式解决了问题:
- 完全删除了整个项目及其文件夹。
- 重新创建项目。
- 确保
%PATH%
变量,除了不相关的路径,包含仅 正确的 Qt build 路径。在我的例子中%PATH%
包含'C:\Qt.5\msvc2013_64\bin'
。 正确 我的意思是,当然,Qt 构建是使用我试图编译的相同编译器构建的。 - 那我运行
VS2013 x64 Native Tools Command Prompt
. - 切换到项目文件夹。
- 然后我做了
qmake
然后nmake
一切都很好。
我认为问题在于,正如drescherjm建议的那样,
If you tried one time with the wrong command prompt then tried again on the same build folder you build folder would have been broken by the bad try.
因此,
You will have to clean build between tries.
感谢drescherjm and Herman Nurlygayanov,问题终于解决了
以下是我从这个问题中得到的一些经验:
- Qt creator 的版本是 32 位 还是 64 位 应该在所有这些东西之前通过检查
About Qt creator
。编译前选择正确版本的命令提示符很重要。 - 此外,如果使用32位命令提示符,则应执行
vcvars32.bat
。至于64-bit版本,应该执行vcvarsall.bat
。它们分别位于%dir of you vs%/vc
和%dir of you vs/vc/bin
。 - 如果在一次编译过程中发生任何错误,则必须在下一次尝试中执行另一个
qmake
。