Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by flberger · Jun 03, 2014 at 03:29 PM · crossplatformdllnotfoundexceptionwindows 8

Fallback handler could not load library on Windows 8

I am making a game in Unity Pro which uses an external C++ DLL.

The HARDWARE_INTERFACE.DLL is wrapped into a class like this:

 class HARDWARE
 {
     [DllImport("HARDWARE_INTERFACE")]
     public static extern bool HARDWARE_Open() ;
 }

The DLL itself is located in Assets/Plugins/.

This is working fine in the editor, and also in a generic Windows build on the development machine which runs Windows 7. In the build, the DLLs are in unity_app/unity_app_Data/Plugins/.

However if I transfer the build to a Windows 8 Desktop machine, the log yields

 Fallback handler could not load library C:/Users/user/Desktop/unity_app/unity_app_Data/Mono/.\C:/Users/user/Desktop/unity_app/unity_app_Data/Plugins/HARDWARE_INTERFACE.dll
 Fallback handler could not load library C:/Users/user/Desktop/unity_app/unity_app_Data/Mono/.\C:/Users/user/Desktop/unity_app/unity_app_Data/Plugins/HARDWARE_INTERFACE
 Fallback handler could not load library C:/Users/user/Desktop/unity_app/unity_app_Data/Mono/libC:/Users/user/Desktop/unity_app/unity_app_Data/Plugins/HARDWARE_INTERFACE.dll
 Fallback handler could not load library C:/Users/user/Desktop/unity_app/unity_app_Data/Mono/.\libC:/Users/user/Desktop/unity_app/unity_app_Data/Plugins/HARDWARE_INTERFACE.dll
 Fallback handler could not load library C:/Users/user/Desktop/unity_app/unity_app_Data/Mono/libC:/Users/user/Desktop/unity_app/unity_app_Data/Plugins/HARDWARE_INTERFACE.dll
 Fallback handler could not load library C:/Users/user/Desktop/unity_app/unity_app_Data/Mono/.\C:/Users/user/Desktop/unity_app/unity_app_Data/Plugins/HARDWARE_INTERFACE.dll
 Fallback handler could not load library C:/Users/user/Desktop/unity_app/unity_app_Data/Mono/.\C:/Users/user/Desktop/unity_app/unity_app_Data/Plugins/HARDWARE_INTERFACE
 Fallback handler could not load library C:/Users/user/Desktop/unity_app/unity_app_Data/Mono/libC:/Users/user/Desktop/unity_app/unity_app_Data/Plugins/HARDWARE_INTERFACE.dll
 Fallback handler could not load library C:/Users/user/Desktop/unity_app/unity_app_Data/Mono/.\libC:/Users/user/Desktop/unity_app/unity_app_Data/Plugins/HARDWARE_INTERFACE.dll
 Fallback handler could not load library C:/Users/user/Desktop/unity_app/unity_app_Data/Mono/libC:/Users/user/Desktop/unity_app/unity_app_Data/Plugins/HARDWARE_INTERFACE.dll
 DllNotFoundException: C:/Users/user/Desktop/unity_app/unity_app_Data/Plugins/HARDWARE_INTERFACE.dll
   at (wrapper managed-to-native) HARDWARE:HARDWARE_Open ()

It looks as if the whole path to the DLL (`C:/Users/user/Desktop/unity_app/unity_app_Data/Plugins/HARDWARE_INTERFACE.dll`) is being appended to the search paths (`C:/Users/user/Desktop/unity_app/unity_app_Data/Mono/`, C:/Users/user/Desktop/unity_app/unity_app_Data/Mono/lib), which of course is nonsense.

How can I make Unity / Mono find the DLLs on the Windows 8 machine?

Any hints will be appreciated.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image BasP · Aug 06, 2014 at 09:50 AM 0
Share

Did you ever figure out the answer? Because I have the exact same problem here.

avatar image BasP · Aug 06, 2014 at 10:36 AM 0
Share

I figured it out. For anyone in the future who is also running into this problem: in my case this was solved by changing the Unity project's architecture from x86_64 to just plain x86. It turned out the dll I was importing wasn't x64 compatible, so check for that. Also, I needed to manually copy the .dll to the same folder where my game's executable resided. Once I did this everything worked.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Windows 8 - DLLNotFoundException. Windows 7 - No problems! 0 Answers

UnauthorizedAccessException when accessing DLL 1 Answer

There's a way to define platform specific assets? 2 Answers

Glow/Spotlight shader reacting different cross-platform 1 Answer

Unity Standard asset Cross Platform Input Manager and mouse input 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges