gpt4 book ai didi

c++ - 在 Sublime text 3 中编译简单的 C++ 程序时出错

转载 作者:行者123 更新时间:2023-11-28 01:25:09 25 4
gpt4 key购买 nike

我已经安装了 Sublime text 3,我想在里面编译 C++ 程序。我提到了 this使 Sublime 兼容编译 C++ 程序的文章,但我不断收到以下错误

C:/Program Files (x86)/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe: cannot open output file C:\Users\USER\Downloads\CCDSAP\sublime/test1.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
[Finished in 1.9s with exit code 1]
[shell_cmd: g++ -std=c++11 -Wall "C:\Users\USER\Downloads\CCDSAP\sublime\test1.cpp" -o "C:\Users\USER\Downloads\CCDSAP\sublime/test1" && "C:\Users\USER\Downloads\CCDSAP\sublime/test1"]
[dir: C:\Users\USER\Downloads\CCDSAP\sublime]
[path: C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Program Files\MATLAB\R2017a\runtime\win64;C:\Program Files\MATLAB\R2017a\bin;C:\Program Files\Git\cmd;C:\Program Files\Amazon\AWSCLI\;C:\Program Files\OpenVPN\bin;C:\WINDOWS\System32\OpenSSH\;C:\Android;C:\Windows\System32;C:\Program Files\Java\jdk-11.0.1\bin;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Users\USER\AppData\Local\Programs\Python\Python36\Scripts\;C:\Users\USER\AppData\Local\Programs\Python\Python36\;C:\Users\USER\AppData\Local\Microsoft\WindowsApps]

遇到这个错误后,我阅读了 this关于 StackOverflow 的问题,我再次尝试使用上面链接中给出的构建代码。但它又给我同样的错误。

请注意,我可以非常流畅地通过CodeBlocks IDE 编译和运行程序,也可以在Windows 上通过命令行调用g++ 命令。有人可以帮忙吗?谢谢。

最佳答案

如果存在权限问题,但应用程序没有运行,则尝试删除.exe文件。

关于c++ - 在 Sublime text 3 中编译简单的 C++ 程序时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54198522/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com