【发布时间】:2014-07-17 18:01:22
【问题描述】:
我正在尝试使用 Visual Studio 2010 中的 cl 来构建 Mixxx 的 32 位版本。 Mixxx 使用 SCons 来构建。我的电脑是 Windows 7 64 位,安装了太多版本的 Visual Studio。
在these instructions 之后,我尝试了setenv 和vsvars 的各种组合和变体,但无论我做什么,在这种情况下我最终都在命令行上:
> cl
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
好的,所以cl 指向“版本 16,x86”——太好了。
> scons toolchain=msvs force32=1 winlib=%cd%\winlib\x86 sqlitedll=0 staticlibs=1 asmlib=0
[... bunch of output truncated, until we start using the compiler ...]
cl /Fores\qrc_mixxx.obj /c res\qrc_mixxx.cc /TP /Zc:wchar_t- /GL /MP /fp:fast /G
[truncated]
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
(注意 - 我破解了 SCons 以删除 /nologo)什么? cl 现在如何表示“版本 18,x64”?它改变了我的环境吗?让我们找出答案:
Terminate batch job (Y/N)? y
>cl
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
所以cl 对终端仍然意味着“版本 16,x86”。但 SCons 总是使用“最新版本,x64”。
(根据我对Windows shell的理解,这应该是不可能的。我杀了脚本,所以它没有做任何清理。cl的含义怎么会变成那样?)
我发现了一些提示:
- http://scons.1086193.n5.nabble.com/Using-32-bit-MSVC-compiler-on-64-bit-Windows-td28062.html
- http://www.scons.org/wiki/MsvsMultipleVersions
- Forcing scons to use older compiler?
基于此,我添加了
Environment(MSVC_VERSION = '10.0')
Environment(TARGET_ARCH = 'x86')
print 'hello world'
到 SConstruct。我不知道 SCons,而且构建脚本很重要,所以很可能我做错了。无论如何,SCons 仍然总是使用“最新版本,x64”。
【问题讨论】:
-
您是否已经尝试联系 Mixxx 项目的维护人员解决此问题?在这种情况下,他们可能会提供最好的帮助......
-
是的,我已发布到邮件列表here。我想我应该已经包含了这个链接。
-
尝试按照comments.gmane.org/gmane.comp.programming.tools.scons.user/… 的说明启用MSVS 初始化过程的调试。如果其他调试消息没有告诉您任何信息,请将您的问题和调试输出发布到 SCons 用户 ML (scons-users@scons.org)。
-
非常感谢,调试技巧正是我所需要的!