lld-link.exe: error: failed to open a.exe: permission denied on windows 10

lld-link.exe: error: failed to open a.exe: permission denied on windows 10

我正在使用 lld-link 从 obj 文件创建 .exe 文件,但发生了这种情况:

我已经搜索过这个错误,常见的答案是 a.exe 被执行了,我必须关闭它,但是我已经在进程浏览器中搜索过它并且没有 a.exe 运行。我还了解到我的 anti-malware 可能是问题所在,所以我将其关闭,但效果不佳。

您正在尝试将 a.exe 写入 C:\Program Files\LLVM\bin。在链接之前 cd 到您的代码目录,或者在命令的 -out:a.exe 部分为 a.exe 指定要保存到的绝对路径。