Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
408 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 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...