Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
409 views
in Technique[技术] by (71.8m points)

xcode - Create framework including .dylib and it's headers for iOS

I need to create a mylib.framework, which is gonna include mylib.dylib with some header files(mylib.h and others). This framework I'm gonna include in another demo app. Just want to know if it is possible and how it must be done?

I tried 2 methods with Xcode 12 and command lines :

1st I created an Xcode framework project and imported headers and dylib. But the produced mylib.framework seems to have access to method definition from mylib.h but not it's binary inside dylib. I got this error :

Undefined symbols for architecture arm64:
  "_mylib_open", referenced from:
      -[ViewController init:] in ViewController.o

2nd method, I followed this SO thread.

Created same

lipo -create mylib.dylib  -output mylib

when adding headers, Info.plist manually, but didn't get the expected result again. This time the demo build perfectly headers seems OK ??. But when it runs on iPhone I get Thread 1: signal SIGABRT and looking deeper I saw this dyld: Library not loaded: @rpath/mylib.dylib.

Some idea ? Is it possible?

question from:https://stackoverflow.com/questions/66049864/create-framework-including-dylib-and-its-headers-for-ios

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...