Starting intro to C++ class and whenever I try adding an existing cpp file to my xcode project, I get this error when building. I have no coding experience, and would really appreciate any help!
Think I just solved my problem literally a min after posting. I deleted the default main cpp file that is included when making a new project and everything works now.
Code:
Ld "/Volumes/Macintosh HD/Users/Ryan/Library/Developer/Xcode/DerivedData/testing-eydhxyuolbhrdqhjjmhkhxoskrub/Build/Products/Debug/testing" normal x86_64
cd "/Volumes/Macintosh HD/Users/Ryan/Desktop/testing"
setenv MACOSX_DEPLOYMENT_TARGET 10.8
"/Volumes/Macintosh HD/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" -arch x86_64 -isysroot "/Volumes/Macintosh HD/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk" "-L/Volumes/Macintosh HD/Users/Ryan/Library/Developer/Xcode/DerivedData/testing-eydhxyuolbhrdqhjjmhkhxoskrub/Build/Products/Debug" "-F/Volumes/Macintosh HD/Users/Ryan/Library/Developer/Xcode/DerivedData/testing-eydhxyuolbhrdqhjjmhkhxoskrub/Build/Products/Debug" -filelist "/Volumes/Macintosh HD/Users/Ryan/Library/Developer/Xcode/DerivedData/testing-eydhxyuolbhrdqhjjmhkhxoskrub/Build/Intermediates/testing.build/Debug/testing.build/Objects-normal/x86_64/testing.LinkFileList" -mmacosx-version-min=10.8 -stdlib=libc++ -o "/Volumes/Macintosh HD/Users/Ryan/Library/Developer/Xcode/DerivedData/testing-eydhxyuolbhrdqhjjmhkhxoskrub/Build/Products/Debug/testing"
duplicate symbol _main in:
/Volumes/Macintosh HD/Users/Ryan/Library/Developer/Xcode/DerivedData/testing-eydhxyuolbhrdqhjjmhkhxoskrub/Build/Intermediates/testing.build/Debug/testing.build/Objects-normal/x86_64/main.o
/Volumes/Macintosh HD/Users/Ryan/Library/Developer/Xcode/DerivedData/testing-eydhxyuolbhrdqhjjmhkhxoskrub/Build/Intermediates/testing.build/Debug/testing.build/Objects-normal/x86_64/Lab3_3_1.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Think I just solved my problem literally a min after posting. I deleted the default main cpp file that is included when making a new project and everything works now.