Skip to content
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/content/platform-integration/bind-native-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,26 @@ void main(List<String> args) async {
The Dart files (`unix.dart`, `windows.dart`) would then contain the `external`
functions that use the symbols from these system libraries.

#### Note on packages that require Android's `libc++_shared.so` dynamic library

The Android NDK developer guide
[C++ library support](libcpp_support) page explicitly states that: "`libc++`
is not a system library. If you use `libc++_shared.so`, it must be included in
your app". This is usually handled by Gradle or included by passing
`-DANDROID_STL=c++_shared` to `cmake`.

[libcpp_support]: {{site.android-dev}}/ndk/guides/cpp-support#cs

If your application or package depends on the C++ standard library or includes
[multiple shared libraries](runtimes), your application will likely need to
bundle the library. This can be done by including the appropriate
`libc++_shared.so` library for the host platform and target architecture in
`build.dart` or by depending on the library convenience package
[`android_libcpp_shared`](libcpp_shared).

[runtimes]: {{site.android-dev}}/ndk/guides/cpp-support#shared_runtimes
[libcpp_shared]: {{site.pub}}/packages/android_libcpp_shared

### Closed-source libraries

You can also use build hooks to link against pre-compiled, closed-source
Expand Down
Loading