๋‚ด ์ธ์ƒ์—์„œ ๋ฏฟ์„ ๊ฑด ์˜ค์ง ๋‚˜ ์ž์‹ ๋ฟ!

The only one you can truly trust is yourself.

๊ฒŒ์ž„ ํ”„๋กœ๊ทธ๋ž˜๋ฐ/ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์ดˆ๋ณด๊ฐ€ ๊ฒช๋Š” ๋ฌธ์ œ๋“ค

gcc์—์„œ __gxx_personality_v0 ์—๋Ÿฌ๋‚  ๋•Œ

๐ŸŽฎinspirer9 2021. 2. 3. 01:06
728x90
๋ฐ˜์‘ํ˜•

gcc ์•„๋ž˜์ฒ˜๋Ÿผ ์˜ค๋ฅ˜๊ฐ€ ๋‚  ๋•Œ

undefined reference to __gxx_personality_v0'

warning: deprecated conversion from string constant to ‘char*’

์ฒซ๋ฒˆ์งธ ์—๋Ÿฌ๋Š”

gcc -g -o server *.cc

๋ฅผ

g++ -g -o server *.cc

๋กœ ๋ฐ”๊พธ๋ฉด ํ•ด๊ฒฐ๋จ.

๋‘๋ฒˆ์งธ ์—๋Ÿฌ๋Š”

ํ•จ์ˆ˜๋ž‘ ๋ฐ์ดํ„ฐ๋ฅผ ๊ต์ฒดํ•˜๋ฉด ๋จ. ์˜ˆ๋ฅผ ๋“ค์–ด,

char* Str = "Hello";

๋ผ๋ฉด,

const char* Str = "Hello";

๊ทธ๋ฆฌ๊ณ 

void DisplayText(char* Text);

๋ผ๋ฉด,

void DisplayText(const char* Text);

์ด๋Ÿฐ ์‹์œผ๋กœ ๊ณ ์น˜๋ฉด ์—๋Ÿฌ๊ฐ€ ๋‚˜์ง€ ์•Š๋Š”๋‹ค.

728x90
๋ฐ˜์‘ํ˜•