János
János

Reputation: 35050

EntryPointNotFoundException Error in C# when Integrating C++ Static Library in Unity Project for iOS

I'm working on a Unity iOS application, and I want to use my C++ code through a static library. I successfully compiled the C++ code into a static library (libMonetization.a). However, when I try to call the IsUserSubscribed function from C# using DllImport, I get an EntryPointNotFoundException error.

Details:

I compiled the static library with these commands: clang -c Monetization.cpp -o Monetization.o -std=c++17 ar rcs libMonetization.a Monetization.o The libMonetization.a file is placed in the Plugins/iOS folder in my Unity project. During the build in Xcode, I am not using any additional linker flags since I'm building the project from the terminal instead of Xcode. Error Message:

EntryPointNotFoundException: IsUserSubscribed assembly: type: member:(null) Monetization.Start () (at Assets/Scripts/Monetization.cs:18) Questions:

  1. How can I ensure that the static library is properly linked and that the
  2. IsUserSubscribed function is correctly called from Unity?
  3. What steps do I need to follow when building the project from the terminal to avoid this error?
  4. Are there any additional settings I need to configure in Unity to integrate the C++ static library properly?

Upvotes: -1

Views: 28

Answers (0)

Related Questions