Solution 1: Use Multiple Targets
1. Create a new target for each file with a main() function:
Go to the File menu, select New, then Target.
Choose a C executable template.
Name the target (e.g., Program1, Program2).
2. Add the desired file to the new target:
In the file inspector on the right, ensure the correct target is checked
for each file.
3. Build and run the target you want:
Select the desired target from the dropdown menu in the toolbar.
Press Run.
This keeps each main() function in its own target, avoiding conflicts.
Read more about the solution here: https://impetusorgansseparation.com/avnneqwn?key=670ae0c3b093d8e8ac42c57aa7da8c14