【问题标题】:access is denied in visual studio code在 Visual Studio 代码中访问被拒绝
【发布时间】:2021-08-02 18:35:08
【问题描述】:

我下载并安装了 vs 代码来运行我的 C++ 程序。当我尝试运行任何程序时,它显示以下错误:

Program 'Untitled-1.exe' failed to run: Access is deniedAt line:1 char:81
+ ...  ($?) { g++ Untitled-1.cpp -o Untitled-1 } ; if ($?) { .\Untitled-1 }
+                                                            ~~~~~~~~~~~~.
At line:1 char:81
+ ...  ($?) { g++ Untitled-1.cpp -o Untitled-1 } ; if ($?) { .\Untitled-1 }
+                                                            ~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed

【问题讨论】:

  • 请重新格式化问题并添加更多详细信息,您做了什么以及得到了什么。
  • #include 使用命名空间标准; int main() { cout
  • 我还是不太明白“visual studio”(微软?)和“g++”(GNU C 编译器?)之间的联系。
  • @U.Windl Visual Studio Code 只是 IDE 部分 - 它不附带编译器(您可以使用 tasks.json 进行配置),因此您可以将它与您想要的任何编译器一起使用。此外,它是跨平台的,因此它不仅仅在 Windows 上运行。
  • 一定是配置错误。您可能需要向我们展示您的 tasks.json

标签: c++ visual-studio-code


【解决方案1】:

问题在于,我的防病毒 mcafee 软件正在停止 vs code 来运行程序并生成可执行的 .exe 文件。要解决此问题,您可以排除文件被扫描。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-01-26
    • 1970-01-01
    • 1970-01-01
    • 2021-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多