I am using Xcode for programming in c++ language
But when I type the code and hit run it tells me there is a problem
How can I solve it? I am a beginner in computer and programming
My MacBook Pro
And this is the problem:
Ld /Users/lamiaa/Library/Developer/Xcode/DerivedData/c-awfbaiszjqjdyzfyhvlstvnfmpbe/Build/Products/Debug/c normal x86_64 (in target 'c' from project 'c')
cd /Users/lamiaalkhunini/Creative\ Cloud\ Files/c
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target x86_64-apple-macos10.15 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -L/Users/lamiaalkhunini/Library/Developer/Xcode/DerivedData/c-awfbaiszjqjdyzfyhvlstvnfmpbe/Build/Products/Debug -F/Users/lamiaalkhunini/Library/Developer/Xcode/DerivedData/c-awfbaiszjqjdyzfyhvlstvnfmpbe/Build/Products/Debug -filelist /Users/lamiaalkhunini/Library/Developer/Xcode/DerivedData/c-awfbaiszjqjdyzfyhvlstvnfmpbe/Build/Intermediates.noindex/c.build/Debug/c.build/Objects-normal/x86_64/c.LinkFileList -Xlinker -object_path_lto -Xlinker /Users/lamiaalkhunini/Library/Developer/Xcode/DerivedData/c-awfbaiszjqjdyzfyhvlstvnfmpbe/Build/Intermediates.noindex/c.build/Debug/c.build/Objects-normal/x86_64/c_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -stdlib=libc++ -Xlinker -dependency_info -Xlinker /Users/lamiaalkhunini/Library/Developer/Xcode/DerivedData/c-awfbaiszjqjdyzfyhvlstvnfmpbe/Build/Intermediates.noindex/c.build/Debug/c.build/Objects-normal/x86_64/c_dependency_info.dat -o /Users/lamiaalkhunini/Library/Developer/Xcode/DerivedData/c-awfbaiszjqjdyzfyhvlstvnfmpbe/Build/Products/Debug/c
But when I type the code and hit run it tells me there is a problem
How can I solve it? I am a beginner in computer and programming
My MacBook Pro
And this is the problem:
Ld /Users/lamiaa/Library/Developer/Xcode/DerivedData/c-awfbaiszjqjdyzfyhvlstvnfmpbe/Build/Products/Debug/c normal x86_64 (in target 'c' from project 'c')
cd /Users/lamiaalkhunini/Creative\ Cloud\ Files/c
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target x86_64-apple-macos10.15 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -L/Users/lamiaalkhunini/Library/Developer/Xcode/DerivedData/c-awfbaiszjqjdyzfyhvlstvnfmpbe/Build/Products/Debug -F/Users/lamiaalkhunini/Library/Developer/Xcode/DerivedData/c-awfbaiszjqjdyzfyhvlstvnfmpbe/Build/Products/Debug -filelist /Users/lamiaalkhunini/Library/Developer/Xcode/DerivedData/c-awfbaiszjqjdyzfyhvlstvnfmpbe/Build/Intermediates.noindex/c.build/Debug/c.build/Objects-normal/x86_64/c.LinkFileList -Xlinker -object_path_lto -Xlinker /Users/lamiaalkhunini/Library/Developer/Xcode/DerivedData/c-awfbaiszjqjdyzfyhvlstvnfmpbe/Build/Intermediates.noindex/c.build/Debug/c.build/Objects-normal/x86_64/c_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -stdlib=libc++ -Xlinker -dependency_info -Xlinker /Users/lamiaalkhunini/Library/Developer/Xcode/DerivedData/c-awfbaiszjqjdyzfyhvlstvnfmpbe/Build/Intermediates.noindex/c.build/Debug/c.build/Objects-normal/x86_64/c_dependency_info.dat -o /Users/lamiaalkhunini/Library/Developer/Xcode/DerivedData/c-awfbaiszjqjdyzfyhvlstvnfmpbe/Build/Products/Debug/c
The error message says you have two main functions in your project. You can have only one.
When you create the project, Xcode includes a main.cpp file that has a main function. If you add a second main function, you are going to get an error. Remove one of the two main functions. If you added your own C++ file to the project, delete the main.cpp function Xcode included with the project.
When you create the project, Xcode includes a main.cpp file that has a main function. If you add a second main function, you are going to get an error. Remove one of the two main functions. If you added your own C++ file to the project, delete the main.cpp function Xcode included with the project.