CE求助
  • 板块学术版
  • 楼主Lime_cat
  • 当前回复8
  • 已保存回复10
  • 发布时间2023/11/18 10:56
  • 上次更新2023/11/18 13:48:38
查看原帖
CE求助
773282
Lime_cat楼主2023/11/18 10:56

rt,错误信息如下:

/tmp/ccxxSWt2.o: in function `add(int, int, int)':
foo.cc:(.text+0x86): relocation truncated to fit: R_X86_64_PC32 against symbol `cnt' defined in .bss section in /tmp/ccxxSWt2.o
foo.cc:(.text+0x98): relocation truncated to fit: R_X86_64_PC32 against symbol `cnt' defined in .bss section in /tmp/ccxxSWt2.o
foo.cc:(.text+0xa3): relocation truncated to fit: R_X86_64_PC32 against symbol `e' defined in .bss section in /tmp/ccxxSWt2.o
foo.cc:(.text+0xae): relocation truncated to fit: R_X86_64_PC32 against symbol `head' defined in .bss section in /tmp/ccxxSWt2.o
/tmp/ccxxSWt2.o: in function `SPFA(int)':
foo.cc:(.text+0x213): relocation truncated to fit: R_X86_64_PC32 against symbol `e' defined in .bss section in /tmp/ccxxSWt2.o
foo.cc:(.text+0x23a): relocation truncated to fit: R_X86_64_PC32 against symbol `head' defined in .bss section in /tmp/ccxxSWt2.o
/tmp/ccxxSWt2.o: in function `SPFA_pre()':
foo.cc:(.text+0x611): relocation truncated to fit: R_X86_64_PC32 against symbol `e' defined in .bss section in /tmp/ccxxSWt2.o
foo.cc:(.text+0x61d): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccxxSWt2.o
foo.cc:(.text+0x66f): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccxxSWt2.o
foo.cc:(.text+0x6ae): relocation truncated to fit: R_X86_64_PC32 against symbol `head' defined in .bss section in /tmp/ccxxSWt2.o
foo.cc:(.text+0x749): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status

add函数如下:

void add(int u,int v,int w)
{
    e[++cnt].to=v;
    e[cnt].dist=head[u];
    e[cnt].val=w;
    head[u]=cnt;
    return;
}

求调qwq

2023/11/18 10:56
加载中...