Can a MAUI iOS binding library be used to wrap a C++ iOS fat library (.a) for mobile platform development?

Brian Johnson 0 Reputation points
2025-02-26T16:08:14.5233333+00:00

I am trying to convert my Xamarin.Forms apps to MAUI. My apps rely on C/C++ library code provided by government agencies (USNO and NOAA). For Xamarin.Forms I was able create NuGet packages for each library using these instructions https://learn.microsoft.com/en-us/xamarin/cross-platform/cpp/. While these packages still work for Android, under iOS I get a dllnotfound exception. I have tried to directly pull the fat library (.a) created in the above procedure into my MAUI app, but no love. I also tried to pull it into a multi-platform class library with similar results.

I am now thinking that an iOS binding library might be the right construct. The instructions provided in the default ApiDefinition.cs file, however, are specific to a library created with Objective-C.

Can an iOS binding library be used with a fat library created with C++? If so, what supporting files are needed? I can successfully build it with no supporting files and get my library wrapped in a DLL. With this, however, the C# references (DLL Import, ect.) I would typically use to access the functions in the DLL still do not work.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,955 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 71,696 Reputation points
    2025-02-26T21:00:06.89+00:00
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.