Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  3. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question DLL cannot set CPU: x86? Missing x86 option?

Discussion in 'Unity 6 Beta' started by restush96, Mar 31, 2024.

  1. restush96

    restush96

    Joined:
    May 28, 2019
    Posts:
    147
    I use Unity 6 but there is no option DLL to set CPU: x86.

    Also seems x86_64 also missing.

    upload_2024-4-1_2-6-55.png
     
    Last edited: Mar 31, 2024
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,939
    It's because there's no Unity Editor x86, thus there's no point in using such dll for the Editor.
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,710
    That's x64.

    As for x86: in case you're trying to configure it for the 32-bit build, you need to select the standalone player tab (as you're configuring the plugin for the editor right now).
     
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,481
    Would a x86 dll still function in the event that you only have a 32-bit binary?
     
  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,939
    Yes. Since it's perfectly normal for x86 binaries to load x86 bit dlls.
     
    Spy-Master and Ryiah like this.
  6. restush96

    restush96

    Joined:
    May 28, 2019
    Posts:
    147
    I did set the x86 dll to 32-bit in player tab. But the dll of steamworks facepunch got these error:

    The type 'Result' exists in both 'Facepunch.Steamworks.Win32, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Facepunch.Steamworks.Win64, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

    The type 'Screenshot' exists in both 'Facepunch.Steamworks.Win32, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Facepunch.Steamworks.Win64, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

    I want to report the issue to Facepunch.Steamworks but seems they don't maintain anymore. So, may I send bug report to Unity instead?
     
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,710
    can you show settings for the player for both plugins?
     
  8. restush96

    restush96

    Joined:
    May 28, 2019
    Posts:
    147
    @Tautvydas-Zilys sure things.

    Could also repro by these steps:
    - Download latest Steamworks.Facepunch
    - Extract it on project like folder Plugins or anywhere
    - There is a warning message pop up from Facepunch.Steamworks.Win32.dll where it doesn't have x86 and will set to AnyCPU.
    - Make sure write a C# code using Steamworks.Data.Screenshot or Steamworks.Result then save
    - Try to set Facepunch.Steamworks.Win32.dll to x64CPU on Unity Editor, then back to AnyCPU
    - Try to build

    Expected:
    No errors
    Actual:
    There is error that type of Screenshot or type of Result exists in Win32.dll and Win64.dll

    DLL Win32
    upload_2024-4-8_7-7-57.png upload_2024-4-8_7-8-13.png upload_2024-4-8_7-8-25.png .


    DLL Win64
    upload_2024-4-8_7-10-19.png upload_2024-4-8_7-10-36.png
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,710
  10. TJNBG

    TJNBG

    Joined:
    Apr 7, 2021
    Posts:
    26
    Interestingly if you delete the 32bit dll and try to run the build, Unity will not load the DLL.
    'Failed to open the requested dynamic library (0x06000000) - The specified module could not be found.  (WinError:0000007e)

    Happens with any native dll. We've yet to produce a working build on Unity 6 (6000.0.0b13)
    :(
     
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,710
    Is that in the built Windows player? Can you check if the DLL gets copied to <GAME_NAME>_Data/Plugins?
     
  12. TJNBG

    TJNBG

    Joined:
    Apr 7, 2021
    Posts:
    26
    They DLLs are in place. Just found out that Unity produced a 32-bit build for BuildTarget.StandaloneWindows64, so that explains why they're not loading.
     
  13. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,710
    That is... new. Can you share your build script? Do you set UnityEditor.WindowsStandalone.UserBuildSettings.architecture anywhere?
     
    TJNBG likes this.
  14. TJNBG

    TJNBG

    Joined:
    Apr 7, 2021
    Posts:
    26
    We weren't setting it. This is the first time I hear about it TBH.
    Setting it to the correct architecture fixed the build. It appears that StandaloneWindows64 in BuildPlayerOptions doesn't default to x64 anymore.
    Thanks!
     
  15. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,710
    It should, I'd still like to see your script that didn't work :).