clang use ld command to make the final link, I checked the manual and found -U
and -undefined
can ignore undefined symbols.post
-U symbol_name ui
Specified that it is ok for symbol_name to have no definition. With two_levelnamespace, the resulting symbol will be marked dynamic_lookup which means dyld will search all loaded images.spa
-undefined treatmentcode
Specifies how undefined symbols are to be treated. Options are: error, warning, suppress, or dynamic_lookup. The default is error.ci
So the final solution is set -Wl,-undefined,dynamic_lookup
to OTHER_LDFLAGS
, also make sure search path set correctly. It works.get