Hi! I am very new to Mac, and spent almost full day trying to sort this out. I want to build c++ dll to call both from window and mac using XCode. So I've made XCode C++ dynamic library app, with setting like this: and I have very simple function in header Code (csharp): extern "C" int __stdcall GetInfo(); and cpp immplementation Code (csharp): extern "C" { int GetInfo() { return 152; } } [ This compiles on mac just fine as dylib. Then, inside Unity, I add it as: Code (csharp): [DllImport("libLibea", EntryPoint = "GetInfo")] public static extern int GetInfo(); and end up getting error: Code (csharp): Can't find PE header for Assets/Plugins/x64/libLibea.dll Failed to load 'Assets/Plugins/x64/libLibea.dll', expected 64 bit architecture (IMAGE_FILE_MACHINE_AMD64), but was IMAGE_FILE_MACHINE_UNKNOWN. You must recompile your plugin for 64 bit architecture. What else am I missing? My architecture is universal. Maybe the problem, is that I rename dylibto dll, without doing something else important?
First of all, for Mac, you need to build a BUNDLE library to be used by Unity. Secondly, I advise you to work with CMake and SWIG to build cross-platform (Windows & Mac) and to have a free wrapper.