C++ dll in hololens

3

I am working creating a hololens application using a native code dll based on c ++. The problem comes when I add it in the unity project (plugins / WSA / x86).

When generating the UWP solution in Visual Studio I get a failure of DllNotFound.

From what I have been able to read, it is necessary to create a UWP library to use it in my application. That library must contain my native code. The truth is that I'm not sure how to do that. Is there any way to stop my dll based on c ++ on a UWP dll ??

error: System.DllNotFoundException: Unable to load DLL 'nativoHololensPrueba.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E).

enter image description here

C++

SOURCE:
  #include <iostream>
  #include <stdio.h>
  #include <memory>
  #include "Header.h"

__declspec(dllexport)
int testo() {
return 10;
}

HEADER:
extern "C" {

__declspec(dllexport)
    int testo();
}

c#

[DllImport("nativoHololensPrueba")]
public static extern int testo();

// Use this for initialization

public GameObject texto;


void Start () {
    texto.GetComponent<TextMesh>().text = "Cambiando el nombre " + testo();
}

enter image description here

c++
visual-studio
unity3d
uwp
hololens
asked on Stack Overflow Nov 2, 2017 by Urko Sanchez Ortiz • edited Nov 2, 2017 by Urko Sanchez Ortiz

1 Answer

0

I also had this and I solved it by compiling the dll on ARM64 (or ARM) with /MT flag.

answered on Stack Overflow Oct 28, 2020 by Eusebiu Marcu • edited Nov 2, 2020 by Eusebiu Marcu

User contributions licensed under CC BY-SA 3.0