纯OC项目默认不设置use_frameworks!,swift项目必须设置use_frameworks!。
一般的私有库为了便于修改,大都是使用源码设计不生成framework库,若不使用use_frameworks!,项目编译时,都是生成.a文件。大家都知道.a库文件可以采用#import "BITLogMacro.h"方式引入其它库的头文件,而framework库需要采用#import <DYSingleObject/BITSingleObject.h>方式访问其它库的头文件。造成私有库可能无法在swift项目或含有swift项目中使用。不然包找不到头文件的如下错误:
Undefined symbols for architecture arm64: "_OBJC_CLASS_$_BITSingleObject", referenced from: objc-class-ref in BITNSObject.o "_bitLogLevel", referenced from: -[BITNSObject configLog] in BITNSObject.o +[BITNSObject initialize] in BITNSObject.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)