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

The only one you can truly trust is yourself.

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

gcc๋ง๊ณ  g++ ์‚ฌ์šฉํ•˜๋ฉด ํ•ด๊ฒฐ๋˜๋Š” ๋ฌธ์ œ

๐ŸŽฎinspirer9 2021. 2. 13. 22:51
728x90
๋ฐ˜์‘ํ˜•

๋„คํŠธ์›Œํฌ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ๋‹ค์‹œ ์‹œ์ž‘ํ•˜๊ธฐ๋กœ ํ•˜๊ณ , 10๋…„์ „์— ์ œ๋Œ€๋กœ ๋ชป ๋๋ƒˆ๋˜ ๋งˆ์ง€๋ง‰ ๊ณผ์ œ, "์›Œํฌ ์“ฐ๋ ˆ๋“œ์— ๋ชฌ์Šคํ„ฐ ์›€์ง์ด๊ณ , ์œ ์ €๊ฐ€ ์ ‘์†ํ•ด์„œ ๊ทธ๊ฑธ ๊ด€์ฐฐํ•  ์ˆ˜ ์žˆ๋Š” epoll ์„œ๋ฒ„"๋ฅผ ๋ชฉํ‘œ๋กœ ๊ณต๋ถ€๋ฅผ ํ•˜๋ ค๊ณ  ํ–ˆ๋Š”๋ฐ,

 

๊ทธ๋ž˜์„œ ๋‹ค์‹œ ์ฒ˜์Œ๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š”๋ฐ...

์ผ๋‹จ ์šฐ๋ถ„ํˆฌ 10.10 - i386์—๋‹ค๊ฐ€ TextEditor๋ž‘ gcc ์ด์šฉ.

 

์„œ๋ฒ„ , ํด๋ผ์ด์–ธํŠธ ์†Œ์Šค ๊ตฌํ•œ๊ฑฐ ๋‘ ๊ฐœ ์ปดํŒŒ์ผ

server.cc , client.cc

 

gcc -g -o server server.cc

ํ•˜๋ฉด ์˜ค๋ฅ˜๊ฐ€ ๋‚จ

/tmp/ccXP80hZ.o : (.eh_frame+0x12): undefined reference to '__gxx_personality_v0' collect2: ld returned 1 exit status

 

์–ด๋””์„œ ๋งŽ์ด ๋ดค๋˜ ์˜ค๋ฅ˜์ธ๋ฐ?

์•Œ๊ณ  ๋ณด๋‹ˆ 2๋…„์ „์—๋„ ๋งŒ๋‚ฌ๋˜ ์˜ค๋ฅ˜,

gcc๋ง๊ณ  g++ ์‚ฌ์šฉํ•˜๋ฉด ํ•ด๊ฒฐ๋จ.

 

g++ -g -o server server.cc

 

์ปดํŒŒ์ผ๋œ ์• ๋“ค์€ ./server ์™€ ./client ๋กœ ์‹คํ–‰

๋ฆฌ๋ˆ…์Šค์—์„œ ์‹คํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•๋„ ๊นŒ๋จน์–ด์„œ ์ด๊ฑฐ๋„ ๋‹ค์‹œ ๊ฒ€์ƒ‰ํ•ด์„œ ์ฐพ์•„๋ƒˆ๋‹ค.

๋‚œ ๋ฐ”๋ณธ๊ฐ€๋ด.

 

์‹คํ–‰ ๊ฒฐ๊ณผ๋Š” ๊ทธ๋ƒฅ server, client ์—ฐ๊ฒฐ๋˜๋Š” ๊ฑฐ.

728x90
๋ฐ˜์‘ํ˜•