๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
โ—๏ธError

[ํ•ด๊ฒฐ๋ฒ• ํฌํ•จ] duplicate symbols for architecture x86_64

by Fomagran ๐Ÿ’ป 2020. 11. 21.
728x90
๋ฐ˜์‘ํ˜•

์•ˆ๋…•ํ•˜์„ธ์š” ์—๋Ÿฌ์ˆ˜์ง‘๊ฐ€ Foma ์ž…๋‹ˆ๋‹ค...

์˜ค๋Š˜๋ถ€ํ„ฐ๋Š” ์—๋Ÿฌ๋ฅผ ๋” ์ด์ƒ ๋„˜์–ด๊ฐ€์ง€์•Š๊ณ  ๋ชจ์•„๋ณด๋ ค๊ณ  ํ•ด์š”. 

 

์˜ˆ์ „๋ถ€ํ„ฐ ์—๋Ÿฌ๋ฅผ ๋งŒ๋‚˜๋ฉด ๋นจ๋ฆฌ ๊ณ ์น˜๊ธฐ์—๋งŒ ๊ธ‰๊ธ‰ํ•˜๊ณ  ๊ณ ์น˜๋ฉด ์•ˆ๋„ํ•˜๋ฉด์„œ ๋„˜์–ด๊ฐ”๋˜์ ์ด ์žˆ๋Š”๋ฐ์š”.

 

์˜ค๋Š˜์€ ์˜ˆ์ „์— ๋˜‘๊ฐ™์€ ์—๋Ÿฌ๋ฅผ ๋งŒ๋‚ฌ๋Š”๋ฐ ์–ด๋–ป๊ฒŒ ํ•ด๊ฒฐํ•ด์•ผํ• ์ง€ ๋ชฐ๋ผ ๋ช‡์‹œ๊ฐ„์„ ํ—ค๋งธ์Šต๋‹ˆ๋‹ค.

 

๊ทธ๋ž˜์„œ ํ•ญ์ƒ ์—๋Ÿฌ๋ฅผ ์ˆ˜์ง‘ํ•ด์„œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์„ ๊ธฐ๋กํ•ด๋†” ์–ด๋–ค ์—๋Ÿฌ๋ฅผ ๋งŒ๋‚˜๋“  ์ซ„์ง€(?)์•Š๋Š” Foma๊ฐ€ ๋˜๋„๋ก ํ• ๊ฑฐ์—์š”.

 

Error


์˜ค๋Š˜์˜ ์—๋Ÿฌ๋Š” ๋ฐ”๋กœ ์ œ๋ชฉ์—์„œ๋ณด์‹œ๋‹ค์‹œํ”ผ "duplicate symbols for architecture x86_64" ๋ผ๋Š” ์—๋Ÿฌ๋ฅผ ๋งŒ๋‚ฌ์Šต๋‹ˆ๋‹ค.

 

๋ญ ๊ฐ„๋‹จํ•˜๊ฒŒ ํ•ด์„ํ•˜๋ฉด 117๊ฐœ ์‹ฌ๋ณผ์ด ๋ณต์ œ๋˜์–ด ์žˆ๋‹ค?? ์ด๊ฒŒ ๋ฌด์Šจ ์†Œ๋ฆฌ์ง€? ํ•˜๊ณ  ๋ฐ”๋กœ ๊ตฌ๊ธ€์— ๊ฒ€์ƒ‰ํ•ด๋ดค์Šต๋‹ˆ๋‹ค.

 

์—ญ์‹œ๋‚˜ ๋งŽ์€ ์‚ฌ๋žŒ๋“ค์ด ๊ฒช์—ˆ๋˜ ์—๋Ÿฌ์˜€์–ด์š”. (์Šคํƒ ์˜ค๋ฒ„ ํ”Œ๋กœ์šฐ ์ตœ๊ณ ...)

 

๋“ค์–ด๊ฐ€์„œ ๊ฐ€์žฅ ๋งŽ์€ ์ถ”์ฒœ์ด ์žˆ๋Š” Answer์„ ๋ณด๋‹ˆ ์ด ๋œป์ด ๋ฌด์—‡์ด๋ƒ๋ฉด

 

" ๋™์ผํ•œ ๊ธฐ๋Šฅ์„ ๋‘ ๋ฒˆ ๋กœ๋“œํ–ˆ๋‹ค๋Š” ์˜๋ฏธ. -ObjC๋ฅผ Other Linker Flags์—์„œ ์ œ๊ฑฐํ•œ ํ›„ ์ด ์˜ต์…˜์ด ๋‘ ๋ฒˆ ๋กœ๋“œ๋œ๋‹ค๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•œ๋‹ค." ๋ผ๊ณ  ํ•˜๋„ค์š”.

 

๊ทธ๋Ÿฌ๋‹ˆ๊น "Other Linker Flags์—์„œ -ObjC๋ฅผ ์ œ๊ฑฐํ•˜์ง€ ๋งˆ!!" ๋ผ๋Š” ์˜๋ฏธ๋กœ ํ•ด์„๋˜์š”.

 

๊ทธ๋Ÿฌ๋ฉด Other Linker Flags๋Š” ์–ด๋””์žˆ๋Š”๋ฐ?

 

๋ฐ”๋กœ Project์—์„œ Build Setting์„ ๋“ค์–ด๊ฐ€์‹ ํ›„ Other Linker Flags๋กœ ๊ฐ€์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

์—ฌ๊ธฐ๋กœ ๊ฐ€์‹œ๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด Other Linker Flags์— -"$(OTHER_LDFLAGS) -ObjC" ๊ฐ€ ์žˆ๋Š”๊ฒŒ ๋ณด์ด์‹ค ๊ฑฐ์—์š”!

 

 

์—ฌ๊ธฐ์— ๋ฐ”๋กœ "$(OTHER_LDFLAGS) -ObjC"๋ฅผ ์ œ๊ฑฐํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. (์•„๋ž˜ ์‚ฌ์ง„์ฒ˜๋Ÿผ)

 

 

๊ทธ๋Ÿผ ์—๋Ÿฌ๊ฐ€ ํ•ด๊ฒฐ๋ ๊ฒ๋‹ˆ๋‹ค.

 

ํ˜น์‹œ๋ผ๋„ ์—๋Ÿฌ๊ฐ€ ํ•ด๊ฒฐ๋˜์ง€ ์•Š์•˜๊ฑฐ๋‚˜ ํ‹€๋ฆฐ ๋ถ€๋ถ„์ด ์žˆ๋‹ค๋ฉด ๋Œ“๊ธ€ ๋‚จ๊ฒจ์ฃผ์„ธ์š” ใ…œ

 

Reference


 

Duplicate symbols for architecture x86_64 under Xcode

I now have the same question with above title but have not found the right answer yet. I got the error: /Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewr...

stackoverflow.com

 

728x90
๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€