<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLLibraryError-swift.struct",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:SC15MTLLibraryErrorLeV"
  },
  "title" : "MTLLibraryError"
}
-->

# MTLLibraryError

Metal errors related to libraries.

```
struct MTLLibraryError
```

## Topics

### Errors

[`unsupported`](/documentation/Metal/MTLLibraryError-swift.struct/unsupported)

Metal couldn’t support the requested action.

[`internal`](/documentation/Metal/MTLLibraryError-swift.struct/internal)

The action caused an internal error.

[`compileFailure`](/documentation/Metal/MTLLibraryError-swift.struct/compileFailure)

The library or function failed to compile.

[`compileWarning`](/documentation/Metal/MTLLibraryError-swift.struct/compileWarning)

The library or function compiled successfully but generated warnings.

[`fileNotFound`](/documentation/Metal/MTLLibraryError-swift.struct/fileNotFound)

Metal couldn’t find the Metal source file.

[`functionNotFound`](/documentation/Metal/MTLLibraryError-swift.struct/functionNotFound)

Metal couldn’t find the specified Metal function.

### Error domain

[`errorDomain`](/documentation/Metal/MTLLibraryError-swift.struct/errorDomain)

The error domain used by Metal when returning library or function creation errors.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)