简体   繁体   English

错误(mingw32/bin/ld.exe 最终链接失败:设备上没有剩余空间)构建 C++ 项目

[英]Error (mingw32/bin/ld.exe final link failed: No space left on device) building C++ project

Basically, yesterday I could program in C++ and today I cannot.基本上,昨天我可以用 C++ 编程,今天我不能。

I'm trying to write a simple hello world program in Eclipse Helios using the MinGW C/C++ compiler and I'm running into several problems, and I believe this one to be the root of it.我正在尝试使用 MinGW C/C++ 编译器在 Eclipse Helios 中编写一个简单的 hello world 程序,但遇到了几个问题,我相信这是问题的根源。

At first the program compiled and built, but when I tried to run it, an error dialogue said the FirstProject.exe file could not be found/does not exist in the launch configuration.起初程序编译并构建,但是当我尝试运行它时,一个错误对话框说在启动配置中找不到/不存在 FirstProject.exe 文件。 However, I got no errors building and I could clearly see the binaries in Debug/FirstProject.exe in my project explorer.但是,我在构建时没有遇到任何错误,并且可以在项目资源管理器中清楚地看到 Debug/FirstProject.exe 中的二进制文件。 I tried refreshing my project explorer and alas, the file disappeared before my eyes.我尝试刷新我的项目资源管理器,唉,文件在我眼前消失了。

I tried building the program again, and that's when I get this error:我再次尝试构建程序,这就是我收到此错误的时候:

c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: final link failed: No space left on device c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe:最终链接失败:设备上没有剩余空间

I don't know what device it's talking about.我不知道它在谈论什么设备。 I have more than 1TB left on this hard drive, so it can't be that.我在这个硬盘上还有超过 1TB 的空间,所以不可能是这样。 I tried emptying my %Temp% folder and recycling bin (suggestions I found trying to search for a solution for this problem) but to no avail.我尝试清空我的 %Temp% 文件夹和回收站(我发现尝试寻找此问题的解决方案的建议)但无济于事。

It may be worth noting that C++ programs I have written in the past are still running.可能值得注意的是,我过去编写的 C++ 程序仍在运行。 I'm very new to programming, so I don't know how much information you need, but I'll gladly add anything you need if you think you can help me out.我对编程很陌生,所以我不知道您需要多少信息,但是如果您认为可以帮助我,我很乐意添加您需要的任何信息。

I just solved this on one of the computers at work which had the same issue when compiling through Codelite.我刚刚在其中一台工作中的计算机上解决了这个问题,这些计算机在通过 Codelite 编译时遇到了同样的问题。 Moving workspaces, rebooting, and reinstalling Codelite didn't fix the problem.移动工作区、重新启动和重新安装 Codelite 并没有解决问题。 I also checked permissions on the /temp folder which were fine.我还检查了 /temp 文件夹的权限,这很好。

It turns out there were permission issues/other issues with the disk.事实证明,磁盘存在权限问题/其他问题。 Running a disk check fixed a few issues on the disk and that allowed the program to compile.运行磁盘检查修复了磁盘上的一些问题,并允许程序编译。 If this doesn't solve your issue you may also want to try disabling any anti-virus/spyware programs and try again.如果这不能解决您的问题,您可能还想尝试禁用任何防病毒/间谍软件程序,然后重试。

I just solved this problem on my PC.我刚刚在我的电脑上解决了这个问题。 Actually what the problem in my case was that my windows defender (or any antivirus in someone's case) was blocking ld.exe from accessing the protected folder that is the source code folder.实际上,我的问题是我的 Windows Defender(或任何防病毒软件)阻止ld.exe访问受保护的文件夹,即源代码文件夹。 You can correct this by going into the Virus and threat protection settings of your PC and then find there for blocked history.您可以通过进入 PC 的病毒和威胁防护设置来更正此问题,然后在那里找到被阻止的历史记录。 You will definitely find there a history record of that blockage.你肯定会在那里找到那个堵塞的历史记录。 Then just go and allow on this device it.然后就去允许在这个设备上吧。 And boom 😁和繁荣😁

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe:最终链接失败:设备上没有剩余空间 - c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: final link failed: No space left on device /Mingw32/bin/ld.exe:找不到-llibcurl? - /Mingw32/bin/ld.exe: cannot find -llibcurl? 如何消除链接器错误 mingw32/bin/ld.exe: 找不到 -lSDL - how do I eliminate linker error mingw32/bin/ld.exe: cannot find -lSDL mingw32/bin/ld.exe ... 对 [class] 的未定义引用 ... collect2.exe:错误:ld 返回 1 个退出状态 - mingw32/bin/ld.exe ... undefined reference to [class] ... collect2.exe: error: ld returned 1 exit status mingw32/bin/ld.exe:找不到 -lfl collect2.exe:错误:ld 返回 1 个退出状态 - mingw32/bin/ld.exe: cannot find -lfl collect2.exe: error: ld returned 1 exit status 视觉工作室代码最终链接上的 Mingw 失败:设备 collect2.exe 上没有剩余空间:错误:ld 返回 1 退出状态 - Mingw on visual studio code final link failed: No space left on device collect2.exe: error: ld returned 1 exit status /mingw32/bin/ld.exe:无法打开输出文件 HelloWorld.exe:权限被拒绝 collect2.exe:错误:ld 返回 1 退出状态 - /mingw32/bin/ld.exe: cannot open output file HelloWorld.exe: Permission denied collect2.exe: error: ld returned 1 exit status GLFW链接无法在C ++中与mingw32正常使用(?) - GLFW link not working correctly with mingw32 in C++ (?) ld.exe ||无法打开输出文件bin \\ Debug \\ <FILENAME> .exe权限被拒绝[C ++] - ld.exe||cannot open output file bin\Debug\<FILENAME>.exe Permission denied [C++] C ++ Mingw32 CreateProcess()失败,错误代码为2:系统找不到指定的文件 - C++ Mingw32 CreateProcess() failed with error code 2: The system cannot find the file specified
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM