NI LabWindows™/CVI™ Failed to Copy Error When Building a DLL or EXE

Updated Jun 15, 2023

Reported In


  • LabWindows/CVI

Issue Details

  • I have a LabWindows™/CVI™ program that was originally created in LabWindows™/CVI™ 2012 and eventually moved to version 2017. When building a Dynamic Link Library (DLL) or an executable (EXE) in LabWindows™/CVI™ 2017 everything worked just fine, but then I upgraded to version 2019 and get the following build error:
  • I am trying to compile a DLL  that I created using LabWindows™/CVI™ 2017, but when I compile it, I receive a similar error to:
Build Status (multicars.prj - Debug)
Link multicars_dbg.exe
Failed to copy d:\Users\Langbein\MultiCars\cvibuild.multicars\Debug\multicars_dbg.exe to d:\Users\Langbein\MultiCars\multicars_dbg.exe. File not found
Build failed.
  • I am rebuilding my LabWindows™/CVI™ 2015 program in LabWindows™/CVI™ 2019. When I try to compile the program, I receive the following error message:
exe cvi.jpg
Build Status (lrspms.prj - Debug)
Link MetLRAFM.exe
Failed to copy e:\PTB Work\Hostsoftware\cvibuild.lrspms\Debug\MetLRAFM.exe to e:\PTB Work\Hostsoftware\MetLRAFM.exe. 

File not found
Build failed.

How can I fix this?


This error can happen for many reasons, which are listed below:
  • The LabWindows™/CVI™ project is not correctly setup. To prevent this error, make sure the build configuration, target type, and target settings are set up correctly in the project.
  • A file included in the build that is not present in the computer. To prevent this, make sure all files included in the DLL or EXE are present in the computer. 
  • It is not permitted to access the file in its current directory. To fix this, move the file to a new location in which the file can be accessed. 
  • A driver or file that is being included in the DLL or EXE is not compatible with LabWindows™/CVI™ or is not up-to-date. With that, ensure all drivers included in your project are up-to-date and compatible with LabWindows™/CVI™. For NI drivers, such information can be found in their readme files

If the issue is not caused by the conditions above, the following steps will be helpful to identify the cause of the problem. 
  • Enable Show Build Output window for errors in the Build Process Options dialog box (Options >>Build Options >>Build Process Options tab). This will show the build log in the workspace window and where the issue might be coming from.
  • If a warning saying that a piece of code in the EXE or DLL won't be executed pops-up, make sure to fix the warning before running the code.
  • Try to uninstall Microsoft.NetFramework software in the computer and reinstall it again, this could be the cause of the LabWindows™/CVI™ malfunction.
  • Try to build a DLL or EXE using one of LabWindows™/CVI™ shipping examples. If this works, then the issue is most likely due to one or more of the files being built into the DLL or EXE.