qkrwpghks   1년 전

컴파일러에서도 오류 떠서 실행이 안되고 제출하면 컴파일 에러 뜹니다 왜그런가요?

/tmp/ccXBSCvG.o: in function `dfs(int, int)':
main.cpp:(.text+0x5a): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccXBSCvG.o
main.cpp:(.text+0x75): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccXBSCvG.o
main.cpp:(.text+0x96): relocation truncated to fit: R_X86_64_PC32 against symbol `vs' defined in .bss section in /tmp/ccXBSCvG.o
main.cpp:(.text+0xb5): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccXBSCvG.o
/tmp/ccXBSCvG.o: in function `main':
main.cpp:(.text+0xd5): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/ccXBSCvG.o
main.cpp:(.text+0xdf): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccXBSCvG.o
main.cpp:(.text+0xe9): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccXBSCvG.o
main.cpp:(.text+0x113): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccXBSCvG.o
main.cpp:(.text+0x11d): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccXBSCvG.o
main.cpp:(.text+0x13a): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccXBSCvG.o
main.cpp:(.text+0x140): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status

[Compilation failed with exit code 1]

azruine   1년 전

4 * 100002 * 100002 해보면 대충 40테라바이트입니다. 전역 변수니까 프로그램 첫 실행시에 저만큼의 메모리를 요청하는데 40TB의 램을 가진 시스템이 아닌 이상 에러를 뱉습니다.

컴파일 단계에서 실패했으면 컴파일러가 메모리 사이즈 보고 컴파일 실패했다고 뱉은거 같네요.

댓글을 작성하려면 로그인해야 합니다.