Error 8 with Application Builder When I Create an Executable

Updated May 9, 2022

Reported In

Software

  • LabVIEW Professional
  • LabVIEW Application Builder Module

Issue Details

  • I ma trying to create an application in LabVIEW but I'm unable to due to write permissions on my C:\Program Files (x86) directory. How can I stop the application from generating files here?
  • When I try to create an application with Application Builder, I get the following build error showing Error 8 occurred. as shown below

Solution

Common Solutions
 
  1. Check permissions on the destination directory. When building an application on a shared network drive, there may be insufficient write permissions to the drive, resulting in Error 8. Saving the executable to a local drive will solve this issue.
    • Make sure to compile using the Windows administrator user (especially if compiling to restricted directories, such as root C:\).
    • Make sure the destination folder is empty and there are no other files that the Application Builder needs to overwrite.
    • Ensure that any previous versions of the compiled application are not open or running in the background. It may be using the same resources that the new compilation is trying to access.
  2. If the PC is using an auto-backup feature, files that are not currently backed up may be locked. This will result in Error 8 due to the auto-backup feature requesting administrative privileges to edit or remove a file that is not currently backed up.
    • Either turn off this feature or save the files in a different location that does not have this feature enabled.
  3. Another application may be accessing the same file, or the file is already open when  creating the executable. For more information, refer to Error 8 When Writing to or Reading from a File.
  4. Windows Firewall or the local Anti Virus program may be blocking the application. Disable both and try to build the application again.
  5. This error can also appear if the file size of the executable is too large (900 MB). Follow the section "Rules for Better Memory Usage" on the VI Memory Usage section in the LabVIEW help.
  6. Try building the application on a Network Drive to ensure that no other software is using the same files.
  7. The error may be caused by incomplete installation. To verify whether this is the case, reinstall LabVIEW. For more information, refer to Installing, Updating, Repairing, and Removing NI Software
 
Other Troubleshooting Options

If the application is attempting to write files to C:\Program Files (x86), or if the error file states:
This error can be due to an option selected while setting up the build for your executable-Copy error code files in the Advanced section of Application Builder. Copy error code files adds copies of XML-based LabVIEW error code text files from the project\errors and user.lib\errors folders to the run-time engine. 

Follow the steps below to resolve this issue:
  1. From the Project Explorer view, right-click Build Specifications. Select New»Application (EXE).
  2. Select the Advanced category of Application Builder and uncheck Copy error code files option as shown below:
    • Disabling this option prevents the Application Builder from writing error log files to the C:\Program Files (x86) directory.


3. Rebuild the application and observe that the error has bee resolved.

Additional Information

Note: For VI's built in 8.5 that have been compiled to LabVIEW 2009 or higher, uncheck the Use LabVIEW 8.x file layout option in the Build Specifications as shown below: