This can sometimes occur when compiling a tripartite library, usually when you add a third-party library file or when you are developing more than one person.
This problem is generally caused by a link error that cannot be found in the file. We can proceed from the following several aspects of the investigation.
1. Take the following error as an example, if the development of more than one person, you have completed synchronization after the following error found.
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 the invocation)
The "Mypagelogviewcontroller" class appears in the error, and you can find the. m file for this class and view his target membeship, as shown below
If there is no tick, click tick. 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 locate the build Settings->linking->other Linker Flags
Modify this property to-all_load or-OBJC, depending on the situation. In short, you can try a few more 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 the 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. The following figure
If none of the above methods works. You can try a few more ways:
1, to see if there are any newly added files with the same name as the previous file
2, the error message appears in the name of a class, go to the original file to see which Third-party library #import, the library to exclude each annotation, find the wrong library, and then follow the official steps to add again.