Native Libraries with the extension ".a"

Ask questions about the iOS API here

Native Libraries with the extension ".a"

Postby ErikaGoldmann » Thu Oct 25, 2012 5:10 am

Hello,

I'm developing with monotouch framework:

I download the opentok-ios-sdk.
Now I have to binding the Native Objective-C, but in the opentok-ios-sdk i was expecting to find a Native Libraries with the extension ".a"

How can I get (or generate) a library/libraries with the extension ".a"? :cry:

Tks
Was this post helpful? (0)
ErikaGoldmann
 
Posts: 2
Joined: Thu Oct 25, 2012 4:45 am
Thumbs Up: 0

Re: Native Libraries with the extension ".a"

Postby ankur » Thu Oct 25, 2012 12:58 pm

Hello Erica,

Libraries with the extension or *.a are simply known as static libraries. We distribute what is called a Framework on the iOS platform, but essentially a Framework is a package in which a static library and associated assets (like images) can be distributed and linked to together.

What this means is that you should be able to use the binary inside the framework in place of the *.a file (you can even rename it to libOpentok.a or something similar if you like). This binary is at the path Opentok.framework/Versions/A/Opentok. The one issue if using the binary directly like this is that you will need to add some code in your MonoTouch plugin or application code to help point to the right place for the assets. The way you can do this is using a value in the Info.plist dictionary. Assign the key "OTAssetBundlePath" to the path inside your application that opentok.bundle can be found. Right now it sits at Opentok.framework/Resources/opentok.bundle.

Let me know if this helps or if you have anymore questions.

-- Ankur
Was this post helpful? (0)
ankur
 
Posts: 356
Joined: Thu Jun 02, 2011 12:37 am
Thumbs Up: 12

Re: Native Libraries with the extension ".a"

Postby ErikaGoldmann » Tue Oct 30, 2012 6:18 am

Sorry for the late reply but my account was block ('username_clean') - issue fixed.

Tanks Ankur for the startup :)

A. I had to rename the binary (path Opentok.framework/Versions/A/Opentok) to libOpentok.a making a static library
B. Then binding a third-party library :
1. I create a monotouch binding project
2. Copy and add it to the project.
3. Automatically generate a code behind file "libOpentok.linkwith.cs" with the dependencies link:
[assembly: LinkWith ("libOpentok.a", LinkTarget.ArmV7 | LinkTarget.Simulator, ForceLoad = true)]
4. API definition - I found out this helpful code:
https://github.com/mono/monotouch-bindi ... ok/binding
C. In the solution, create a monotouch iPhone empty project
1. Add the opentok.bundle
2. In the Info.plist iOS Target Prperties assign "OTAssetBundlePath" (as you recommended)
3. Include my .dll (binding project)
4. Create a derived class of OTSessionDelegate
5. In my Main interface
// Derived Class
OTSessionHandler otHandler= new OTSessionHandler();
6. In the ViewDidLoad ()
OTSession session = new OTSession("key", otHandler);
session.Connect("apikey", "token");

Build and... Boom :/

Error Message:
(...)

Undefined symbols for architecture i386:
"_VDADecoderCreate", referenced from:
_ff_vda_create_decoder in libOpentok.a(vda.o)
"_VDADecoderDecode", referenced from:
_ff_vda_decoder_decode in libOpentok.a(vda.o)
"_VDADecoderDestroy", referenced from:
_ff_vda_destroy_decoder in libOpentok.a(vda.o)
"_kVDADecoderConfiguration_Height", referenced from:
_ff_vda_create_decoder in libOpentok.a(vda.o)
"_kVDADecoderConfiguration_SourceFormat", referenced from:
_ff_vda_create_decoder in libOpentok.a(vda.o)
"_kVDADecoderConfiguration_Width", referenced from:
_ff_vda_create_decoder in libOpentok.a(vda.o)
"_kVDADecoderConfiguration_avcCData", referenced from:
_ff_vda_create_decoder in libOpentok.a(vda.o)
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

error MT5202: Native linking failed. Please review the build log.
Was this post helpful? (0)
ErikaGoldmann
 
Posts: 2
Joined: Thu Oct 25, 2012 4:45 am
Thumbs Up: 0

Re: Native Libraries with the extension ".a"

Postby Geeks » Wed Nov 07, 2012 5:32 am

Hi,

I have exactly the same problem here.

Any solutions?
Was this post helpful? (0)
Geeks
 
Posts: 5
Joined: Wed Nov 07, 2012 4:53 am
Thumbs Up: 0

Re: Native Libraries with the extension ".a"

Postby ankur » Thu Nov 08, 2012 10:11 am

Hey Erika and Geeks,

I'm not familiar with the specifics of MonoTouch as a framework, but I can give you some more detail looking at the errors you are getting. Those symbols are used for Publishing video which is not supported in the Simulator, it would only work on the device. Can you try to see what happens if you remove the LinkTarget.Simulator from your step 3 above? Lets just see if that builds, and if so if we can get it on the device. Then maybe we can try to see if we can get a Universal binary that supports both i386 and armv7 architectures.

-- Ankur
Was this post helpful? (0)
ankur
 
Posts: 356
Joined: Thu Jun 02, 2011 12:37 am
Thumbs Up: 12

Re: Native Libraries with the extension ".a"

Postby vid1981 » Thu Nov 08, 2012 12:13 pm

Thanks ankur. I am also having the same issue, though my errors differ a bit. I have built just supporting armv7 architectures.

Undefined symbols for architecture armv7:
"_ff_fft_fixed_calc_neon", referenced from:
_ff_fft_fixed_init_arm in Opentok.a(fft_fixed_init_arm.o)
"_ff_fft_calc_neon", referenced from:
_ff_fft_init_arm in Opentok.a(fft_init_arm.o)
"_ff_fft_permute_neon", referenced from:
_ff_fft_init_arm in Opentok.a(fft_init_arm.o)
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status

Any ideas?

Thanks in advance!
Was this post helpful? (0)
vid1981
 
Posts: 1
Joined: Thu Nov 01, 2012 6:53 am
Thumbs Up: 0

Re: Native Libraries with the extension ".a"

Postby Geeks » Fri Nov 09, 2012 2:47 am

Hi guys,

I managed to solve the problem by referencing the native frameworks used in libOpenTok.a in my Monotouch project.

In iPhone Build / Additional mtouch arguments: "-gcc_flags=\"-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks -framework Security -framework CFNetwork -framework CoreMedia -framework AudioToolbox -framework CoreAudio -framework CoreVideo\"".

The problem now is that I get : Wrapper type "opentok.OTSession" is missing its native ObjectiveC class "OTSession".

It seems something is wrong with opentok.dll !!

Thanks,

G
Was this post helpful? (0)
Geeks
 
Posts: 5
Joined: Wed Nov 07, 2012 4:53 am
Thumbs Up: 0

Re: Native Libraries with the extension ".a"

Postby charley » Fri Nov 09, 2012 2:59 pm

vid1981 wrote:Undefined symbols for architecture armv7:
"_ff_fft_fixed_calc_neon", referenced from:
_ff_fft_fixed_init_arm in Opentok.a(fft_fixed_init_arm.o)
"_ff_fft_calc_neon", referenced from:
_ff_fft_init_arm in Opentok.a(fft_init_arm.o)
"_ff_fft_permute_neon", referenced from:
_ff_fft_init_arm in Opentok.a(fft_init_arm.o)
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status

I haven't seen this ld error before, however I did rebuild ffmpeg on our last release, which went out last night. Please pull from origin/master and let me know if you're still having linking issues.
Was this post helpful? (0)
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33

Re: Native Libraries with the extension ".a"

Postby Geeks » Mon Nov 26, 2012 9:45 am

charley wrote:
vid1981 wrote:Undefined symbols for architecture armv7:
"_ff_fft_fixed_calc_neon", referenced from:
_ff_fft_fixed_init_arm in Opentok.a(fft_fixed_init_arm.o)
"_ff_fft_calc_neon", referenced from:
_ff_fft_init_arm in Opentok.a(fft_init_arm.o)
"_ff_fft_permute_neon", referenced from:
_ff_fft_init_arm in Opentok.a(fft_init_arm.o)
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status

I haven't seen this ld error before, however I did rebuild ffmpeg on our last release, which went out last night. Please pull from origin/master and let me know if you're still having linking issues.


Hi, I downloaded the latest library but I still get the same issue.
Was this post helpful? (0)
Geeks
 
Posts: 5
Joined: Wed Nov 07, 2012 4:53 am
Thumbs Up: 0

Re: Native Libraries with the extension ".a"

Postby charley » Mon Nov 26, 2012 9:58 am

Do you have anything in your ldflags? I think it's "Other Linker Flags" on the xcode build settings panel.
Was this post helpful? (0)
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33

Re: Native Libraries with the extension ".a"

Postby Geeks » Tue Nov 27, 2012 5:20 am

charley wrote:Do you have anything in your ldflags? I think it's "Other Linker Flags" on the xcode build settings panel.


I am using Monodevelop.
Was this post helpful? (0)
Geeks
 
Posts: 5
Joined: Wed Nov 07, 2012 4:53 am
Thumbs Up: 0

Re: Native Libraries with the extension ".a"

Postby charley » Tue Nov 27, 2012 9:40 am

Can you send me the whole build log? I recommend using something like gist.
Was this post helpful? (0)
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33

Re: Native Libraries with the extension ".a"

Postby Geeks » Wed Nov 28, 2012 2:04 am

charley wrote:Can you send me the whole build log? I recommend using something like gist.


git clone git://gist.github.com/4160005.git gist-4160005

Thanks,

G
Was this post helpful? (0)
Geeks
 
Posts: 5
Joined: Wed Nov 07, 2012 4:53 am
Thumbs Up: 0

Re: Native Libraries with the extension ".a"

Postby charley » Wed Nov 28, 2012 2:55 pm

Hmm- this build log does not include the actual call to ld, so I can't see what the linker is being passed. I can confirm those symbols are indeed sitting unresolved in the latest commit for opentok-ios-sdk, however there is no reason the linker should complain about this unless it has been instructed to resolve all symbols at link-time. I will keep digging at the unresolved symbols, but this should not be a showstopper for your build process.
Was this post helpful? (0)
charley
 
Posts: 418
Joined: Fri May 06, 2011 7:41 pm
Thumbs Up: 33

Re: Native Libraries with the extension ".a"

Postby habassa5 » Tue Dec 11, 2012 2:32 pm

Does anyone have the new OpenTok WebRTC for iOS SDK written in Monotouch?
Was this post helpful? (1)
habassa5
 
Posts: 31
Joined: Mon Mar 05, 2012 4:32 pm
Thumbs Up: 1


Return to iOS (Native)



Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron