如何告诉 scons 使用 MinGW 而不是 MSVC [英] How to tell scons to use MinGW instead of MSVC
问题描述
我正在尝试在 Windows 上构建 zxing 的 C++ 端口,但 scons 失败:
I'm trying to build the C++ port of zxing on Windows, but scons fails with:
cl : Command line error D8021 : invalid numeric argument '/Wextra'
我同时安装了 VS2010 和 MinGW,并且 scons 尝试使用 MSVC 编译器,即使 SConscript 文件假定 gcc 并使用 gcc 特定的参数,这会导致错误.
I have both VS2010 and MinGW installed, and scons tries to use the MSVC compiler, even though the SConscript file assumes gcc and use gcc-specific parameters, which causes the error.
如何告诉 scons 改用 MinGW?
How can I tell scons to use MinGW instead?
推荐答案
Scons 在 Windows 上默认使用 MSVC 编译器.要在创建环境对象时设置 mignw 编译器使用工具参数.
Scons uses MSVC compiler by default on windows. To set mignw compiler use tools parameter while creating Environment object.
env = Environment(tools = ['mingw'])
然后使用 env.Program() 而不是 Program().
And then use env.Program() instead of Program().
这篇关于如何告诉 scons 使用 MinGW 而不是 MSVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!