clang: error: unable to execute command: Executable “ld“ doesn‘t exist!

我不是女神ヾ 2022-11-15 14:19 334阅读 0赞
  1. 如题所示,我在minix3中直接安装了clang,然后使用如下命令编译c程序报错。
  2. # clang hello.c -o hello
  3. clang: error: unable to execute command: Executable "ld" doesn't exist!
  4. clang: error: linker command failed with exit code 1 (use -v to see invocation)
  5. #
  6. 提示说缺少ld,其实需要安装binutils这个工具,可以通过pkgin\_cd in binutils:
  7. # pkgin_cd in binutils
  8. Checking for CD in /dev/c0d2p2.
  9. /dev/c0d2p2 is mounted on /mnt
  10. Found.
  11. database for /mnt/install/packages is up-to-date
  12. calculating dependencies... done.
  13. nothing to upgrade.
  14. 1 packages to be installed: binutils-2.23.2 (8912K to download, 35M to install)
  15. proceed ? [Y/n] Y
  16. downloading packages...
  17. binutils-2.23.2.tgz 100% 8912KB 8.7MB/s 8.7MB/s 00:01
  18. installing packages...
  19. installing binutils-2.23.2...
  20. pkg_install warnings: 0, errors: 0
  21. reading local summary...
  22. processing local summary...
  23. updating database: 100%
  24. marking binutils-2.23.2 as non auto-removable
  25. #
  26. 这时候系统中就有了ld命令了。
  27. ![20210401222928832.png][]
  28. 再次编译,顺利通过。
  29. ![20210401223157958.png][]
  30. 其实,这个问题一般不会出现,是我自己少安装了binutils,直接安装了clang,不知道有没有遇到同样问题的同学。

发表评论

表情:
评论列表 (有 0 条评论,334人围观)

还没有评论,来说两句吧...

相关阅读