Failed to load dll - UWP - Dll path duplicated

Hi,
I’m importing a native DLL (compiled in aarch64 release mode with make) that I import in Unity for ARM64 (Hololens2 with UWP), with the right parameters in the inspector.
On the Hololens, the dll is placed in : C:/Data/Users/DefaultAccount/AppData/Local/DevelopmentFiles/Template3DVS.Release_ARM64.immersion/AprilTagARM64.dll

But when I run it I got the error :
The Dll fails to load : Failed to load : 'C:/Data/Users/DefaultAccount/AppData/Local/DevelopmentFiles/Template3DVS.Release_ARM64.immersion/C:/Data/Users/DefaultAccount/AppData/Local/DevelopmentFiles/Template3DVS.Release_ARM64.immersion/AprilTagARM64.dll.dll', expected ARM64 architecture, but was Unknown architecture. You must recompile your plugin for ARM64 architecture.

As you can see the path to the dll is duplicated, so I presume the dll is not find by Unity, of course there is no dll placed in the (duplicated) path described by the error… Does anyone has an idea ?

Thank you.

I think this might be just a bug in the error message. It does this before displaying the error message: GetApplicationFolder() + '/' + pluginPath + ".dll" How are you loading it? Does it work if you try to load it in a non-Unity UWP app on HoloLens?

I forgot to mention that with another dll compiled with Visual studio (same ARM64), the dll is placed in the same folder and Unity find this one (even when there is an error, the path is correct). I call them with :

[DllImport("DllName", EntryPoint = "entry"]
static extern void Test();

So you think that the problem comes from the dll which has an Unknown architecture ?

Yeah. However, I don’t think it’s an architecture folder, but rather how you compiled it. You said you used make to build it… what compiler and linker flags did you specify?

I used aarch64-linux-gcc but I guess that it is not compatible with UWP …

Are you trying to run a Linux binary on UWP? That will not work. You need to build against Windows SDK, define “WINAPI_FAMILY=WINAPI_FAMILY_APP” and use “/APPCONTAINER” linker flag (or whatever the equivalent for gcc is).