Skip to content

Commit 2a52d5f

Browse files
committed
Clarify that NativeLibrary can be used for transitive dependencies as well
1 parent 8a1b320 commit 2a52d5f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/core/deploying/native-aot/interop.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ On Windows, Native AOT uses a prepopulated list of direct P/Invoke methods that
4747
4848
### Linking
4949

50-
To statically link against an unmanaged library, you need to specify `<NativeLibrary Include="filename" />` pointing to a `.lib` file on Windows and a `.a` file on Unix-like systems.
50+
To statically link against one or more unmanaged libraries, you need to specify `<NativeLibrary Include="filename" />` pointing to a `.lib` file on Windows and a `.a` file on Unix-like systems for each library.
5151

5252
Examples:
5353

@@ -61,6 +61,10 @@ Examples:
6161
</ItemGroup>
6262
```
6363

64+
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.
65+
66+
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.
67+
6468
To specify additional flags to the native linker, use the `<LinkerArg>` item.
6569

6670
Examples:

0 commit comments

Comments
 (0)