我试图在Windows 10 collidingmice上构建Qbs示例x64,并得到以下错误消息:
Qt5Cored.lib(Qt5Cored.dll) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86'我尝试在collidingmice.qbs中设置以下内容
qbs.architecture : "x64"并收到了消息
'x64' differs from the architecture produced by this compiler (x86)然后我试着
qbs.architecture : "x86_64"给出了错误信息;
'x86_64' differs from the architecture produced by this compiler (x86)然后我试着
qbs.architecture : "x86"给出了错误信息;
Qt5Cored.lib(Qt5Cored.dll) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86'是否有一种方法来设置目标机器类型,例如,Qbs中的'x86'或'x64'?
发布于 2017-09-14 14:51:45
我的猜测是,您使用的是x86编译器和x64 Qt,这是行不通的。你是怎么建立你的个人资料的?
发布于 2020-05-11 02:53:23
下面是我在使用Qbs构建系统构建应用程序时如何解决相同问题的方法(“贴图”,游戏tilemap编辑器)。在我的例子中,我使用的是VisualStudio2019 x64工具链。
注意:这个答案假设Qt和Qbs在您的路径上。
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64在命令提示符中初始化VS2019环境变量。cd myprojectmkdir build-myproject
cd build-myprojectqbs setup-toolchains --detect,它将找到您的VS2019环境。qbs setup-qt --detect,它应该找到您的Qt环境(假设您添加到PATH)。qbs config --list profiles以显示检测到的工具链配置文件。示例:
qbs config --list profiles
profiles.MSVC2019-x64.cpp.compilerVersion: "19.25.28614"
profiles.MSVC2019-x64.cpp.toolchainInstallPath: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64"
profiles.MSVC2019-x64.qbs.architecture: "x86_64"
profiles.MSVC2019-x64.qbs.targetPlatform: "windows"
profiles.MSVC2019-x64.qbs.toolchainType: "msvc"
...qbs build -f ..\MyAwesomeProject.qbs profile:MSVC2019-x64只要Qt的x86构建可用,就可以以类似的方式完成x86的构建。使用vcvarsall.bat运行x86批处理文件将设置命令提示符,以使用VS x86环境变量。
https://stackoverflow.com/questions/46214459
复制相似问题