The error message contains sensitive words and cannot be submitted.
Xcode didn't remind me to update the settings.
Here are a few solutions that I tried but none of them worked.
Corrupted Build Cache / Derived Data (Very Common): Stale or inconsistent files from previous builds, especially after Xcode upgrades, can cause linker errors.
Solution: Perform a thorough clean: In Xcode: Product > Clean Build Folder (or Shift+Cmd+K). Crucially: Delete Derived Data. Quit Xcode. Go to Xcode > Settings (or Preferences) > Locations. Click the small arrow next to the "Derived Data" path to open it in Finder. Delete the entire Derived Data folder (or at least the subfolder corresponding to your project). Restart Xcode and your iOS device. If using CocoaPods, navigate to your project directory in Terminal and run pod install again after deleting Derived Data. Try building and running again.
Inconsistent Build Settings: Mismatches in build settings between your project, the main app target, and the target that produces yituart.debug.dylib (if it's separate) are frequent culprits.
Solution: Verify consistency for all relevant targets (Project, App Target, yituart.debug.dylib target) and all configurations (Debug/Release): iOS Deployment Target: Ensure it's consistently 15.0 or lower everywhere. C++ Language Dialect: Ensure it's identically set to GNU++20 everywhere. Any mismatch (e.g., one target using C++14, another
C++20) can cause linking errors. C++ Standard Library: Ensure it's set to libc++ everywhere. C++20 Dialect vs. Deployment Target: Using a newer standard like C++20 while targeting an older OS like iOS 15 can sometimes lead to build/link issues, even if the runtime OS (iOS 17) supports it well. The build process might create fragile links based on the older target SDK.
Solution (Diagnostic Step): Temporarily change the C++ Language Dialect from GNU++20 to a more widely compatible standard like GNU++17 or GNU++14 across all relevant targets and configurations. Perform the thorough clean again (Clean Build Folder + Delete Derived Data). Rebuild and run. If the error disappears, it points to an incompatibility related to using C++20 features while targeting iOS 15. If the error persists, C++20 itself is less likely the direct cause.
Dependency Issues (CocoaPods, etc.): Problems with how third-party libraries (Pods) are integrated or built.
Solution: Ensure Pods are correctly installed. A clean reinstall might help:
Close Xcode.
In Terminal (in project directory): pod deintegrate
rm Podfile.lock
rm -rf Pods/
rm -rf *.xcworkspace
pod install
Delete Derived Data again.
Reopen the .xcworkspace file in Xcode and try building.