静态库编译与引用


初步测试静态库
添加引用了库后,在设备与模拟器编译运行会出现因库的目标不同而出错,如:error: missing required architecture i386 in file
解决方法:查看 Library search path设置,有可能自动添加了PATH,删除相关库的PATH。
PS:编译目标的不同,引用的库也应该不同(设备与模拟器),自动根据编译模式进行引用
详细教程:

header search path:
${PROJECT_DIR}/../staticlib_project/build/${BUILD_STYLE}-${PLATFORM_NAME}/usr/local/include

llibrary search path参考header search path

http://osmorphis.blogspot.com/2010/02/static-libraries-in-iphone-projects.html

http://osmorphis.blogspot.com/2010/02/static-libraries-in-iphone-projects_08.html


原文地址:https://www.cnblogs.com/qq78292959/p/2076941.html