i am building a C project with Xcode and when ever i build it it gives me this error:
ld: duplicate symbol _detectLinux in /Users/markszymanski/Desktop/Programming/C/iTermOS/build/iTermOS.build/Debug/iTermOS.build/Objects-normal/i386/linuxDetect.o and /Users/markszymanski/Desktop/Programming/C/iTermOS/build/iTermOS.build/Debug/iTermOS.build/Objects-normal/i386/iTermOS.o
Thanks!
This means you have defined the same symbol with global scope in (at least) two different source files — either a function or a global variable called
_detectLinux, and apparently in the fileslinuxDetect.candiTermOS.c.How to fix it depends on how you intend to use this symbol:
If you meant to define it in one file and use it in the other file, declare it
externin the other file.If you only intend to use the symbol in the file that it is declared in, you can declare it
static.If the symbol is defined in both files, you can rename the symbol in one (or both) files.