You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu虚拟机中GCC编译C++程序出现断言失败与段错误求助

Ubuntu虚拟机编译C++程序时链接器触发段错误问题

我在VirtualBox的Ubuntu虚拟机中编译一款C++程序时出现segmentation fault(段错误),该程序此前在Windows系统下运行无报错。

错误日志如下:

/usr/bin/ld: BFD (GNU Binutils for Ubuntu) 2.38 assertion fail ../../bfd/reloc.c:8580
/home/rafael/projects/Send06/lib/x86-64//libstar-api.a(dwzh.o):fake:(.idata$2+0x0): dangerous relocation: collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
compilation terminated.
make: *** [Makefile:382: Send06] Error 1

我理解segmentation fault的含义,但无法理解为何会由外部库引发,且该库的源码不可用。

已采取的排查步骤:

  • 编译「Hello World!」程序——无报错。
  • 扩大虚拟机RAM——无变化。

能否请您帮忙解决?提前感谢!

系统信息:

  • 主机系统:Windows 10
  • 虚拟机:Ubuntu 22.04.01 LTS
  • IDE:Qt Creator 8
  • 编译器:gcc 11.2.0

内容的提问来源于stack exchange,提问作者rafa

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.23 11:06:19