Consuming a Static Library created in c++ in MAUI for iOS Deployment.

Atul Godbole 0 Reputation points
2025-03-11T10:40:35.3933333+00:00

Hello,

I have a c++ library that is for Signal Processing. This is being built for arm64, arm64e. I have created an iOS Binding Library that consumes *.a static library and imports methods.

I am referencing this binding library in my MAUI Project.

I have paired Visual Studio on Windows with a M1 MAC and an iOS Device is connected. I am trying to deploy on this iOS device, but when I build the MAUI Project I am getting below error:

===================

clang++ exited with code 1:

Undefined symbols for architecture arm64:

  "_Analysis", referenced from:

      <initial-undefines>

  "_SetTestConfig", referenced from:

      <initial-undefines>

  "_Startup", referenced from:

      <initial-undefines>

 

ld: symbol(s) not found for architecture arm64

 

clang++: error: linker command failed with exit code 1 (use -v to see invocation)

 ===================

The static library was previous being used in Xamarin.iOS and it was working correctly. This is a Migration project.

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

2 answers

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,086 Reputation points Microsoft External Staff
    2025-03-12T04:57:11.42+00:00

    Hello,

    clang++: error: linker command failed with exit code 1 this error means that some method(_Analysis,_SetTestConfig,_Startup) is referenced that does not have an implementation in the arm64 binary (.a file) or some objects are null. The root issue is in the library.

    You could check these methods in your library and see if they are not implemented.

    Best Regards,

    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Varnika Tygai 0 Reputation points
    2025-03-12T06:47:39.2766667+00:00

    clang++ exited with code 1: Undefined symbols for architecture arm64: "_Analysis", referenced from: "_SetTestConfig", referenced from: "_Startup", referenced from:

    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.