Bug 2530 - [feature] Consider adding support for framework libs in LinkWithAttribute
Summary: [feature] Consider adding support for framework libs in LinkWithAttribute
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: 5.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Jeffrey Stedfast
Depends on:
Reported: 2011-12-15 11:10 UTC by Jeffrey Stedfast
Modified: 2015-09-24 13:46 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jeffrey Stedfast 2011-12-15 11:10:03 UTC
We might need to add an IsFramework bool attr to LinkWithAttribute which would change the linker commands it adds to mtouch's command-line.

From the MonoTouch mailing list:

I had previously tried to get the Wahoo Fitness ANT+ api working with
Monotouch but it appeared to have the dreaded THUMB issue.  Now that 5.1.1
is supposed to resolve that I went to try again.  Previously the API was
distributed as a static lib (.a file) but it is now a static framework.  I
have not seen any official docs on how to bind to a static framework.

I have seen another post that referes to using -F{Dir containing the
framework} and using -framework {static framework name}.  I guess I am
wondering if this is correct?

I am getting errors while building that appear to be related to the fact
that the static framework requires CoreBluetooth.  If I link SDK files only
with no build options to reference CoreBluetooth I get errors that some
symbols are missing.  If I try to include a -framework or -weak_framework
with CoreBluetooth I get an error that it can't find CoreBluetooth.  If I
dont link any assemblies I still get ld: framework not found CoreBluetooth.
This message shows up even though I do not reference the CoreBluetooth in my
build options which are as follows :
-v -v -v -cxx -gcc_flags "-F${ProjectDir}/Lib -framework WFConnector
-framework ExternalAccessory    -framework Security  -ObjC  -lstdc++
-all_load "

The framework I am trying to bind is the WFConnector.framework. Reading the
5.0 changes it appears that CoreBluetooth should be available, but it may
have something to do with me not setting up the WFConnector.framework
Comment 1 Miguel de Icaza [MSFT] 2012-02-18 23:01:55 UTC
Jeff, can you build the test case and prototype the solution?
Comment 2 Alex Soto 2012-06-04 20:34:47 UTC
Did this ever got added??
Comment 3 Jeffrey Stedfast 2012-06-05 11:03:18 UTC
This is really a documentation issue, no code changes are really needed.

When I opened this bug report, I didn't realize that a "framework" is really just a static library.

All that a user needs to do is rename the framework to libFramework.a and it'll Just Work(tm).
Comment 4 Alex Soto 2012-06-05 11:09:03 UTC
Yeah I found out after posting to this bug hehe sorry =) btw you need someone dedicated to have MonoTouch bindings updated since making pull request take some time until someone from Xamarin team review them. Just my 2 cents =) btw thanks for the great tools you make developing a joy!!

Comment 5 Jeffrey Stedfast 2012-06-05 11:40:37 UTC
No need to apologize :-)

I'll poke the MonoTouch guys to review pull requests on the monotouch-bindings repo.
Comment 6 Sean Hoffman 2015-09-24 13:26:12 UTC
@Jeffrey Stedfast what do you mean by "All that a user needs to do is rename the framework to libFramework.a"

Are you talking about renaming the .framework directory? Or do you mean something else? Or is it the file that has no extension in the root of the .framework directory that needs to be renamed?

Comment 7 Sean Hoffman 2015-09-24 13:26:50 UTC
Also is there any official xamarin documentation on this atm?
Comment 8 Jeffrey Stedfast 2015-09-24 13:46:24 UTC
I was talking about the actual library file within the .framework directory (which I believe has no extension).

.a is the file extension for static libraries on Unix systems.