---
title: "linkedLibrary(_:_:)"
framework: packagedescription
role: symbol
role_heading: Type Method
path: "packagedescription/linkersetting/linkedlibrary(_:_:)"
---

# linkedLibrary(_:_:)

Declares linkage to a system library.

## Declaration

```swift
static func linkedLibrary(_ library: String, _ condition: BuildSettingCondition? = nil) -> LinkerSetting
```

## Parameters

- `library`: The library name.
- `condition`: A condition that restricts the application of the build setting.

## Discussion

Discussion This setting is most useful when the library can’t be linked automatically, such as C++ based libraries and non-modular libraries. note: First available in PackageDescription 5.0.

## See Also

### Configuring Linker Settings

- [linkedFramework(_:_:)](packagedescription/linkersetting/linkedframework(_:_:).md)
- [unsafeFlags(_:_:)](packagedescription/linkersetting/unsafeflags(_:_:).md)
