我已按照 https://github.com/TideSDK/TideSDK/wiki/Windows7-x86-2005
上的说明设置了所有内容但是,scons 不会从 PATH 中获取“rc”:
> scons -s debug=1 sdkinstaller run=1
...
runs fine for a while, until:
...
cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be
removed in a future release
cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be
removed in a future release
boot_win32.cpp
'rc' is not recognized as an internal or external command,
operable program or batch file.
scons: *** [build\win32\objs\boot\support\winboot.res] Error 1
> rc
fatal error RC1107: invalid usage; use RC /? for Help
> echo %path%
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsof
t Visual Studio 8\VC\BIN;C:\Program Files\Microsoft Visual Studio 8\Common7\Tool
s;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\WINXP\Microsoft.NET
\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages;C
:\Program Files\ImageMagick-6.8.0-Q16;C:\WINXP\system32;C:\WINXP;C:\WINXP\System
32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Git\cmd;C:\Program
Files\Git\bin;C:\Python25\Scripts;C:\Python25
谷歌搜索这个问题建议的解决方案是将 VC bin 目录添加到 PATH,但正如您所看到的,这已经就位了。
注意:我也安装并使用了 scons 2.2.0,但它甚至无法识别“cl”。至少在 scons 1.2.0 中它可以识别“cl”,但不幸的是不能识别“rc”
第一次在 Windows 上构建,欢迎任何建议!
虚拟机便宜且易于使用。我推荐一个干净的构建环境,不受多个 SDK 版本的污染。
我的系统上需要多个 VC 版本。
通过将
print(env.Dump())
添加到我的 SConscript 文件中,我可以看到 SCons 搜索以查找 rc.exe
的路径。 ENV > PATH 显示 C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64
作为路径之一,而我的 Windows 套件安装将 rc.exe
和 rcdll.dll
放在 C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64
中。
将
rc.exe
和 rcdll.dll
复制到 C:\Program Files (x86)\Windows Kits\10\bin\x64
解决了我的问题。
对于我上面命名的文件路径的
x86
版本也可以这样做。
可能对其他人有帮助,但 Visual Studio 有自己的 CMD,它将设置这些路径。只需打开相应的 Visual Studio CMD 并从那里进行编译即可。