Similar problem.
At first my Main.vi was generating this error, but it is a vision application. At that time, Disconnect type definitions was unchecked and Remove unused members of project libraries under the Additional Exclusions category was checked.
I then unchecked Disconnect type definitions and also unchecked Remove unused members of project libraries under the Additional Exclusions category. This did not fix the problem but then the imaqdx.vi generated the build error instead of my main.vi.
I then enabled debugging, which in the long-term I need to disable for security reasons. But for now, it did a Successful build when I enabled debugging.
I do not call the imaqdx.vi directly and I have built this application many times previously without much trouble. However, I do notice that the imaqdx.vi is in the vi.lib under NI_Vision_Acquisition_Software.lvlib but I am not able to remove it.