I'm very new to Xcode and am trying to use it to write and build C code. I made a project and got everything to work (it'll run Hello World and all that) but once I add a second file to the project (so that I don't have to create a whole new workspace and project and such for every new file I want to work on) the build fails and I get this error:
Apple Mach-O Linker (Id) Error
Linker command failed with exit code 1 (use -v to see invocation)
I don't know what any of that means. Once I get to the error it says all this:
duplicate symbol _main in:
/Users/JacobSax/Library/Developer/Xcode/DerivedData/C_Programming-ezejclzfpncidecllfwsjhptguwi/Build/Intermediates.noindex/C Programming.build/Debug/C Programming.build/Objects-normal/x86_64/Program 2.o
/Users/JacobSax/Library/Developer/Xcode/DerivedData/C_Programming-ezejclzfpncidecllfwsjhptguwi/Build/Intermediates.noindex/C Programming.build/Debug/C Programming.build/Objects-normal/x86_64/Program 3.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I just want to be able to have multiple files in my project so I don't have to make a new workspace or project whenever I'm writing code. Forgive me for my lack of knowledge. Thanks.