didwlvv   7년 전

컴파일 에러가 뜨는 따로 경고 표시된곳은 없습니다. 그런데 밑에 해석을 못해가지고그러는데 해석 한번만 부탁드릴게요 ㅜ

Main.cc: In function ‘void init()’:
Main.cc:38:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
                    ^
Main.cc:41:37: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
             scanf(" %c", &map[i][j]);
                                     ^
/tmp/ccCWOgwv.o: In function `init()':
Main.cc:(.text+0xad): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccCWOgwv.o
Main.cc:(.text+0xb3): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccCWOgwv.o
Main.cc:(.text+0xcf): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccCWOgwv.o
Main.cc:(.text+0xd5): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccCWOgwv.o
Main.cc:(.text+0xeb): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccCWOgwv.o
Main.cc:(.text+0xf1): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccCWOgwv.o
/tmp/ccCWOgwv.o: In function `solve()':
Main.cc:(.text+0x354): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccCWOgwv.o
Main.cc:(.text+0x35b): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccCWOgwv.o
Main.cc:(.text+0x36c): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccCWOgwv.o
Main.cc:(.text+0x373): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccCWOgwv.o
Main.cc:(.text+0x37a): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status

ntopia   7년 전

정의가 중복돼서 link하다 에러난 것 같네요

s라는 전역symbol이  standard library에 있는 것과 중복된 듯 합니다. 이름을 한번 바꿔보시죠

didwlvv   7년 전

제가 바꿔봤는데 바꾼이름으로 똑같이 그러네요

멀로 바꿔도 바뀐 이름으로 똑같은 에러가 생깁니다 ㅜㅜ 도무지  모르겠네요 멀 잘못했는지

ntopia   7년 전

사실 이런 문제는 소스를 직접 보지 않고선 해결하기 어렵습니다...

bupjae   7년 전

혹시 4GB 크기에 거의 가깝거나 넘는 배열 선언을 하셨나요? 또는, 선언한 배열 크기의 합이 4GB에 거의 가깝거나 넘나요?

didwlvv   7년 전

4GB? 제가 소스 올려볼게요

qja0950   7년 전

정확한 원인을 잘 모릅니다만, bupjae 님이 언급하신 메모리 관련으로 생각하보면

int chk[105][105][105][105][105][105]; 을 선언하셨는데

int는 4바이트이므로, 저 배열만 생각하면 5360382562500바이트이고,  약 5000GB네욥.

didwlvv   7년 전

아,,, 배열 크기가 

100이라 생각을 못했네요

와,,,, 감사 다시 해보겠습니다.

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