【问题标题】:collect2.exe: error: ld returned 1 exit status in eclipse cdtcollect2.exe:错误:ld 在 eclipse cdt 中返回 1 退出状态
【发布时间】:2017-11-17 00:59:12
【问题描述】:

我是编程初学者。我正在使用 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)

【问题讨论】:

  • 如果您的系统中有运行,请尝试关闭任何防病毒软件。尝试以管理员身份运行 Eclipse...
  • 感谢您帮助我...
  • 我不敢相信它是否有效。做到了 ? :)

标签: c eclipse eclipse-cdt


【解决方案1】:

通常(根据我的经验),LD 错误是由于您不包括必要的库或链接器造成的。转到您的项目,右键单击,选择属性,在 C 构建下转到设置,GCC C 编译器并包含并添加库。

【讨论】:

    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 2014-09-03
      • 2017-12-18
      • 1970-01-01
      • 2022-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-12
      • 1970-01-01
      相关资源
      最近更新 更多