Solution
This occurs because the executable cannot locate its required gRPC libraries. After the build, the executable searches for dependent libraries using a path that does not match the actual deployment location. The base path may resolve to a base path on the system while the libraries are located elsewhere.
Use the VI Path After Build approach to dynamically determine the executable's location at runtime and construct a relative path to the required gRPC libraries.
- Open the VI that initializes the gRPC server in your LabVIEW project.
- On the block diagram, place the Application Directory VI (found under Programming » File I/O » File Constants). This VI returns the directory where the built executable resides at runtime.
- Use the Build Path function to append the relative subfolder where the gRPC libraries are located. For example, if the libraries are in a subfolder called "gRPC_Libs," build the path as:
Application Directory + "gRPC_Libs" - Pass this constructed path to the gRPC initialization function instead of using a hardcoded or development time path.
- Open the build specification for your executable. Under Source Files, confirm that the gRPC library files are included and that their destination folder matches the relative path you used in step 3.
- Build the executable and deploy it to the target machine.
- Run the executable and verify that the gRPC server responds to client requests.
The executable resolves the gRPC library path relative to its own location at runtime, regardless of where it is deployed. The gRPC server initializes correctly and responds to client input.