【发布时间】:2014-09-07 13:43:23
【问题描述】:
我最近安装了 mingw-w64 并尝试使用 SCons 构建程序。这是我一直在尝试使用的SConstruct 文件的示例:
env = Environment(tools = ['mingw'])
env.Program('test.c')
但是,我收到以下错误:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly
File "C:\Python27\Scripts\scons.py", line 199, in <module>
gcc -o test.o -c test.c
'gcc' is not recognized as an internal or external command,
operable program or batch file.
scons: *** [test.o] Error 1
scons: building terminated because of errors.
我已经正确设置了我的PATH变量,并且可以通过命令行使用gcc,所以奇怪的是SCons找不到它。 gcc的位置是C:\Program Files\mingw-w64\mingw64\bin。
我觉得奇怪的另一件事是必须指定工具。手册页说 mingw 是它的第二个偏好。我猜这与上述问题有关。
【问题讨论】: