Search code examples
iosflutterzeromqffidart-ffi

How to Link Lib.a in IOS, static as well as dynamic linking?


I have some open source c++ library , I have converted into lib.a for different IOS architecture, how can I link this library in Xcode For IOS Devices.

http://wiki.zeromq.org/build:iphone

Reference Link

The Main Target is to first test this in IOS environment and then add it to Flutter, using Flutter FFi package, If anyone have done such kind of work please guide.


Solution

  • I got my Solution,if using cocoa pods for managing dependencies I had to add these lines s.vendored_libraries = 'Frameworks/lib.a' s.pod_target_xcconfig = { "OTHER_LDFLAGS" => "-force_load $(PODS_TARGET_SRCROOT)/Frameworks/lib.a -lstdc++" }

    other way to is to in Build Setting of Xcode go to tab Link libraries with binary and chose the lib.a file, add compiler linker flag in other flag section, compiler flags should be same with which to you build the library, add necessary header search path,