This problem usually occurs when you add a third-party library file or when you develop multiple people.
This problem is usually a link error that is caused by a file not being found. We can proceed from the following aspects of the investigation.
1. Take the following error as an example, if you are a multi-person developer, you will find the following error when you complete the synchronization.
- Undefined Symbols for Architecture armv7:
- "_objc_class_$_mypagelogviewcontroller", referenced from:
- Objc-class-ref in BAIDUMOBSTATAPPDELEGATE.O
- Ld:symbol (s) not found for architecture armv7
- Clang:error:linker command failed with exit code 1 (use-v to see invocation)
The "Mypagelogviewcontroller" class appears in the error, and you can find the. m file for this class and see his target membeship, as
If it is not checked, click on the check box. And then compile the view.
2. If it is a newly added third-party library and is not a static library
Repeat the first step and then find the Build settings->linking->other Linker Flags
Modify this property to-all_load or-OBJC, depending on the situation. In short, you can try more than a few times.
3. If you are adding a third-party static library (. a file)
- Undefined Symbols for Architecture armv7:
- "_objc_class_$_baidumobstat", referenced from:
- Objc-class-ref in BAIDUMOBSTATAPPDELEGATE.O
- Objc-class-ref in MYPAGELOGVIEWCONTROLLER.O
- (Maybe you meant: _objc_class_$_baidumobstatappdelegate)
- Ld:symbol (s) not found for architecture armv7
- Clang:error:linker command failed with exit code 1 (use-v to see invocation)
Errors have occurred in all files used in this library, such as the Baidumobstatappdelegate class and the Mypagelogviewcontroller class
This could be a link error caused by this static library path confusion.
Workaround: Build settings->search path->library Search Paths Add the appropriate path to the static library. Such as
"Linker command failed with exit code 1" file path changed to make compilation error