From 2a52d5f99ff172f4e5d935caa170150d9d4fae35 Mon Sep 17 00:00:00 2001 From: Jonathan Sweemer Date: Thu, 3 Oct 2024 18:26:25 +0900 Subject: [PATCH] Clarify that NativeLibrary can be used for transitive dependencies as well --- docs/core/deploying/native-aot/interop.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/core/deploying/native-aot/interop.md b/docs/core/deploying/native-aot/interop.md index 665287e9cba91..959bf14393b57 100644 --- a/docs/core/deploying/native-aot/interop.md +++ b/docs/core/deploying/native-aot/interop.md @@ -47,7 +47,7 @@ On Windows, Native AOT uses a prepopulated list of direct P/Invoke methods that ### Linking -To statically link against an unmanaged library, you need to specify `` pointing to a `.lib` file on Windows and a `.a` file on Unix-like systems. +To statically link against one or more unmanaged libraries, you need to specify `` pointing to a `.lib` file on Windows and a `.a` file on Unix-like systems for each library. Examples: @@ -61,6 +61,10 @@ Examples: ``` +If the specified native library has a dependency on other static libraries, then `NativeLibrary` items will need to be added for each of the transitive depenencies as well, otherwise the native linker will fail because of missing symbols. + +Platform conventions are followed when it comes to the format of `NativeLibrary` entries. The underlying native linker may search standard library paths or allow rooted file paths. + To specify additional flags to the native linker, use the `` item. Examples: