Reputation: 35050
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:
IsUserSubscribed
function that sends an HTTP request to check if a user is subscribed.DllImport
like this:
[DllImport("__Internal")]
private static extern bool IsUserSubscribed(string
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:
Upvotes: -1
Views: 28