微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

nm:尽管已安装最新的binutils Ubuntu 20.04,但未找到命令

如何解决nm:尽管已安装最新的binutils Ubuntu 20.04,但未找到命令

我正在尝试从源代码构建GCC,当我尝试使用./configure --prefix=/tmp/gcc配置gmp 4.3.2时,出现以下错误消息

checking if globals are prefixed by underscore... ./configure: line 30083: nm: command not found
unkNown
configure: WARNING: +----------------------------------------------------------
configure: WARNING: | Cannot determine global symbol prefix.
configure: WARNING: | nm output doesn't contain a global data symbol.
configure: WARNING: | Will proceed with no underscore.
configure: WARNING: | If this is wrong then you'll get link errors referring
configure: WARNING: | to ___gmpn_add_n (note three underscores).
configure: WARNING: | In this case do a fresh build with an override,configure: WARNING: |     ./configure gmp_cv_asm_underscore=yes
configure: WARNING: +----------------------------------------------------------
checking how to switch to read-only data section...     .section        .rodata
checking for assembler .type directive... .type $1,@$2
checking for assembler .size directive... .size $1,$2
checking for assembler local label prefix... configure: WARNING: "nm" failure
configure: WARNING: cannot determine local label,using default L
L
checking for assembler byte directive... .byte
checking how to define a 32-bit word... ./configure: line 30423: nm: command not found
./configure: line 30423: nm: command not found
configure: error: cannot determine how to define a 32-bit word

我已经安装了binutils-2.34-6ubuntu1,我在网上找到了命令nm所在的位置,但是我无法通过which命令找到它。如果还有其他信息需要解决此问题,请告诉我。

谢谢您的帮助。

解决方法

sudo apt-get install --reinstall binutils解决了这个问题。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。