c++ - 如何修复 Windows 上 Sublime Text 3 中的 "Permission denied collect2.exe: error: ld returned 1 exit status"

标签 c++ windows sublimetext3

所以,在 Sublime Text 3 中,我编写了一个 .cpp 文件,我是编译器,并且有:

C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot open output file C:\Users\okera\Desktop\CRUD/main.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
[Finished in 0.8s]

最佳答案

此答案是引用 Windows 10 上的 Sublime 编辑器 3 提供的。

答案是 .exe 文件仍在后台运行,这就是您无权再次运行它的原因。

根据我的经验,有一个简单的修复方法。

第 1 步:打开任务管理器

第 2 步:打开“详细信息”选项卡(这只是显示去向的示例)

enter image description here

第 3 步:在您的情况下,您想要在“名称”部分中找到的程序是 ma​​in.exe

第 4 步:找到它后,单击它,然后单击“任务管理器”窗口右下角的“结束任务”。

第 5 步:现在,您的程序已结束运行。转到 Sublime 并再次构建您的代码。

您的代码肯定会运行。

如果仍然出现任何错误,请告诉我。 谢谢。

关于c++ - 如何修复 Windows 上 Sublime Text 3 中的 "Permission denied collect2.exe: error: ld returned 1 exit status",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56140030/

相关文章:

c++ - 需要帮助将滚动条添加到编辑框

c++ - gmock - 如何使用 noexcept 说明符模拟函数

c++ - 移动构造函数的后置条件是什么?

c# - WPF:如何在具有不同名称的 for 循环内创建 UserControl 的多个实例?

javascript - 如何在 Linux 上获取 Sublime Text 3 的 console.log 输出?

c++ - 通过 shared_ptr 访问 calloc 的数据

windows - git filter-branch --tree-filter 结果为 'unknown revision or path not in the working tree'

node.js - NodeJs 服务器无法从互联网访问

sublimetext3 - 如何在 Sublime Text 3 中将文本文件 (.txt) 显示为带颜色的代码文件

sublimetext3 - 如何更改键盘映射以在 Sublime Text 上添加选择插入符号?