【发布时间】:2018-06-23 22:44:23
【问题描述】:
我正在尝试在 Windows 下使用 scons + MSVC 编译器编译一个简单的程序。程序源码就是简单的“Hello world”。
#include <iostream>
using namespace std;
int main() {
cout << "Hello World!\n";
return 0;
}
SConstruct 非常简单:
Program("hw.cc")
当我在源目录中运行 scons 时,我得到了
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
cl /Fohw.obj /c hw.cc /TP /nologo
scons: *** [hw.obj] Error 123
scons: building terminated because of errors.
在控制台和弹出消息中出现 0xc000007b 错误。
where 命令的 Aslo 结果:
where cl
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\Hostx86\x86\cl.exe
where scons
C:\Python35-32\Scripts\scons.bat
我不知道出了什么问题。
UPD 2
【问题讨论】:
-
在控制台中运行
cl /Fohw.obj /c hw.cc /TP /nologo,看看是否有任何错误。 -
编译器开始抱怨找不到包含文件。
-
什么版本的scons?你有安装vswhere吗?如果有,它在哪里?
-
@bdbaddog,我有 SCons v3.0.0。 vswhere 在
C:\Program Files (x86)\Microsoft Visual Studio\Installer,但不在 PATH 中。 -
在你的 windows shell 中试试这个:设置 SCONS_MSCOMMON_DEBUG=
,然后将你的日志文件的内容粘贴到这里并发布到这里..