nmake.exe 一直抱怨我没有给它的标志。 (U1065)
当我从 make
运行 nmake.exe
时,出现此错误:
Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fatal error U1065: invalid option '-'
但我没有在任何地方将“-”作为选项传递。
如果我从外部运行相同的命令,则它可以正常工作。
When I run nmake.exe
from make
I get this error:
Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fatal error U1065: invalid option '-'
But I'm not passing in '-' as an option anyplace.
If I run the same command from outside of make it works correctly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
问题在于环境变量
MAKE
和MAKEFLAGS
是由make
设置的。这些令人困惑的nmake.exe
。要解决此问题,只需在对
nmake.exe
的调用前添加env -u MAKE -u MAKEFLAGS
示例:
The problem is that the environment variables
MAKE
andMAKEFLAGS
are set bymake
. These are confusingnmake.exe
.To fix this, just prefix your call to
nmake.exe
withenv -u MAKE -u MAKEFLAGS
Example:
假设您使用的是 Windows 提示命令,并且您有这样的规则
:
注意:没有
unset
命令Supposing you are on a windows prompt command, and you have a rule like that:
by
note: there is no
unset
command如果您使用Windows,只需进入系统设置中的环境变量并删除系统变量“MAKEFLAGS”即可。它不应该再让 Nmake 感到困惑了。
if you use windows, simply go to Enviroment Variables in advance system setting and delete system variables "MAKEFLAGS". It should not confuse Nmake anymore.
只需使用 ,它会将 MAKEFLAGS 设置为空
设置 MAKEFLAGS=
just use , it will set MAKEFLAGS Empty
set MAKEFLAGS=