LinkWithAttribute LinkWithAttribute Class

Definition

A LinkWith attribute specifies how the native library associated with the assembly should be linked to the resulting application.

[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)]
public sealed class LinkWithAttribute : Attribute
type LinkWithAttribute = class
    inherit Attribute
Inheritance
LinkWithAttributeLinkWithAttribute
Attributes

Remarks

This attribute is only useful for assemblies that bind to native libraries.

When using this attribute, the specified library in the constructor will be linked with the final application. You can use one or more of the properties of the attribute to configure how the linking is done.


// The following is used to link with GoogleAdMobAds:

[assembly: LinkWith ("libGoogleAdMobAds.a", LinkTarget.Simulator | LinkTarget.ArmV7, ForceLoad = true, Frameworks = "AudioToolbox MessageUI SystemConfiguration CoreGraphics MediaPlayer StoreKit", WeakFrameworks = "AdSupport", IsCxx = true, SmartLink = true, LinkerFlags = "-lz -lsqlite3")] [assembly: LinkerSafe]

Constructors

LinkWithAttribute() LinkWithAttribute()

Creates a new LinkWithAttribute to specify custom build/linker flags for the managed assembly.

LinkWithAttribute(String) LinkWithAttribute(String)

Creates a new LinkWithAttribute for the specified native library.

LinkWithAttribute(String, LinkTarget) LinkWithAttribute(String, LinkTarget)

Creates a new LinkWithAttribute for the specified native library targetting the specified platform(s).

LinkWithAttribute(String, LinkTarget, String) LinkWithAttribute(String, LinkTarget, String)

Creates a new LinkWithAttribute for the specified native library targetting the specified platform(s).

Properties

Dlsym Dlsym

Specifies if the managed assembly requires using dlsym to resolve P/Invokes to native functions.

ForceLoad ForceLoad

Specifies whether or not the -force_load gcc argument is required when linking this native library.

Frameworks Frameworks

Specifies a space-delimited list of platform Frameworks required by the native library.

IsCxx IsCxx

Specifies whether or not the native library is a C++ library.

LibraryName LibraryName

The name of the native library.

LinkerFlags LinkerFlags

Additional linker flags that are required for linking the native library to an application.

LinkTarget LinkTarget

The target platform (or platforms) that this library is built for.

NeedsGccExceptionHandling NeedsGccExceptionHandling

Specifies whether or not the native library requires linking with the GCC Exception Handling library (libgcc_eh).

SmartLink SmartLink

If this is set true, the ForceLoad value will be ignored when it is deemed safe to do so.

WeakFrameworks WeakFrameworks

Specifies a list of space-delimited platform Frameworks that should be weakly linked.

Applies to