Library Not Found or Failed to Load When Importing DLL in LabVIEW

Updated Feb 5, 2024

Reported In

Software

  • LabVIEW

Issue Details

After importing my DLL into a LabVIEW VI uisng a Call Library Funciton Node, the run arrow is broken and I receive the following errors:

The library specified for this node cannot be found or cannot be loaded. Right-click the Call Library Function node and select Configure, then choose the correct library name or path.
 

Error loading "C:\Program Files\National Instruments\LabVIEW 2015\resource\lvanlys.dll".
A dynamic link library (DLL) initialization routine failed.
 

Solution

This issue can occur due to multiple reasons including, but not limited to, an incorrect file path to the Dynamic Link Library (DLL) or dependencies required by the DLL not being located. Try the troubleshooting steps below to resolve these errors.
 
  • Right-click the Call Library Function Node (CLFN) used to call the DLL and ensure that the specified location of the DLL is correct.
  • Confirm the bitness of the DLL matches with the bitness of the LabVIEW version you are using. If you try to run a 32-bit DLL from LabVIEW 64-bit or vice-versa, you might encounter this error.
  • ​Load your DLL into a dependency checker program that will make sure that you are not missing any dependencies. 
    • There is an open source dependency checker on GitHub that can be useful for this, although it is not the only software that would work for checking dependencies.
    • To solve a missing dependency problem, you will need to place the dependency in the correct location or statically include the dependency when you build the DLL. The particular methods for doing this will depend on your programming language and particular application.
  • If possible, contact the developer of the DLL and ask whether there are dependencies that require the installation of additional software. 
  • Ensure that your Windows account has permission to read the file. The external link Access Control Overview from Microsoft contains information about managing permissions.
  • This issue can also occur after updating your Windows OS. Please make sure all of the dependencies of your DLL (e.g., FTD2xx.dll) are not removed after the Windows update.
  • Make sure no other program like Source Code Control or anti-virus are blocking the DLL.

Additional Information

Windows 64-bit does not support mixed 64-bit/32-bit processes, that is why the bitness of the DLL and LabVIEW needs to match. Windows 10/11 uses two directories for program installations, 64-bit programs are located in the Program Files directory and 32-bit programs are located in the Program Files (x86) directory.