I've been new to xCode and facing this issue while adding a new file to existing project. The error I receive is :
duplicate symbol _main in: /Users/jagtapawan/Library/Developer/Xcode/DerivedData/pdf-gowwoupvsiukblehcdbaeublehki/Build/Intermediates/pdf.build/Debug/pdf.build/Objects-normal/x86_64/main.o /Users/jagtapawan/Library/Developer/Xcode/DerivedData/pdf-gowwoupvsiukblehcdbaeublehki/Build/Intermediates/pdf.build/Debug/pdf.build/Objects-normal/x86_64/func.o ld: 1 duplicate symbol for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
what I do is File -> New -> File. on the left panel select iOS source -> objective c -> next. It insists me to to enter
File: func
File type : Empty
Class : NSObject
my file hierarchy in Xcode is this way :
-func.m
----main.m
--products
whereas in finder the func.m and main.m are in the same folder pdf. please help me
main()
function in bothfunc.m
andmain.m
? You should only have one inmain.m
. – Eric Galluzzomain
functions linked together in the same program. To run two different "mains", you need two programs. – Phillip Mills