Hi there I am new to C programming and have been using Xcode to write my simple CS HW. They have been working fine until a couple weeks ago when I keep getting this error code below. I went ahead and try to run some old programs that I know for sure works but still get this error. I looked everywhere and can’t find the solution. If you have a solution please help. Although I would love a specific answer, I am very new to this and would hope you take that into consideration when explaining. Thank you very much.
Ld /Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Products/Debug/Test normal x86_64
cd /Users/------/Desktop/Test
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Developer/usr/bin/clang -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -L/Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Products/Debug -F/Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Products/Debug -filelist /Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Intermediates/Test.build/Debug/Test.build/Objects-normal/x86_64/Test.LinkFileList -mmacosx-version-min=10.7 -o /Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Products/Debug/Test
ld: duplicate symbol _main in /Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Intermediates/Test.build/Debug/Test.build/Objects-normal/x86_64/HW4.o and /Users/------/Library/Developer/Xcode/DerivedData/Test-gehcspqxloqgaahbdyjslulobzys/Build/Intermediates/Test.build/Debug/Test.build/Objects-normal/x86_64/HW3.o for architecture x86_64
Command /Developer/usr/bin/clang failed with exit code 1
what is this error code?
Command /Developer/usr/bin/clang failed with exit code 1
ld: duplicate symbol _main
This means that you have two main functions inside the same project. Considering the names of your .o files (HW4.o and HW3.o) I am guessing that you are trying to compile two projects at the same time and are somehow linking them, thus having two main functions.