Search Unity

UnityPluginLoad not beeing called in a WSA application

Discussion in 'Windows' started by splevel11, Sep 17, 2015.

  1. splevel11

    splevel11

    Joined:
    Aug 25, 2015
    Posts:
    6
    Under v5.2, what could be the reasons the fn entry UnityPluginLoad of a plugin in a WSA build being no longer called? The same source compiled for PCStandalone woks fine. I verified the dll's exports, and other exported functions can be called from scripts just fine, so the DLL is deployed and correctly found. How does one suggest tracking this down? The debug output does not show anything out of the ordinary,


    [RESOLVED] I had removed the Module Definition file from the linker options, assuming the __declspec(dllexport) in the source file was sufficient. By removing it, all the exported functions were then defined with a '_' prefix. Adding the Module Definition file back into the linker option fixed it.
     
    Last edited: Sep 18, 2015
  2. binarynate

    binarynate

    Joined:
    May 11, 2017
    Posts:
    4
    I just ran into this issue and followed the steps in this helpful article to resolve it:

    https://medium.com/@bengreenier/building-native-unity-plugins-with-visual-studio-8f470e5af9ca

    Like the OP mentioned, the issue is that the UnityPluginLoad function gets prefixed with an underscore when building for x86 (_UnityPluginLoad) unless you use a .def file. This article I linked to provides an example of a .def file and describes how to set it in Visual Studio.