C - collect2.exe:错误:LD 在 Eclipse CDT 中返回 1 个退出状态



我是编程初学者。我正在使用Eclipse CDT进行C编程。当我构建任何程序时,控制台窗口会显示以下消息。请告诉我一个具体的方法,以便我解决这个问题。

控制台窗口:

Info: Configuration "Debug" uses tool-chain "MinGW GCC" that is unsupported on this system, attempting to build anyway.
Info: Internal Builder is used for build
gcc -O0 -g3 -Wall -c -fmessage-length=0 -o test.o "..\test.c" 
gcc -o test.exe test.o 
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.9.2/../../../../i686-pc-mingw32/bin/ld.exe: cannot open output file test.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
00:33:35 Build Finished (took 2s.385ms)

通常(根据我的经验(,LD 错误是由于您没有包含必要的库或链接器而导致的。转到您的项目,右键单击,选择属性,在 C build 下转到设置、GCC C 编译器并包含和添加库。

您的操作系统根本不允许在使用文件时对其进行修改,因此编译失败,因为编译器无法删除旧的可执行文件并放置新的可执行文件。要解决此问题,只需重新启动 eclipse 程序即可。

最新更新