Why do I get "fatal error C1083: Cannot open compiler generated file" when using Visual Studio?

Note: Applies to RTI Connext 4.x and above.

When using Visual Studio to build the project files generated by rtiddsgen, you may see the following error message:

[source file name]:fatal error C1083: Cannot open compiler generated file:[object file name] is generated.

The error is due to the fact that Visual Studio can compile multiple projects at one time. The generated sample solutions contain two projects that use common files. It is common for instances of the compiler to attempt to reference the same file at the same time. 

To avoid running into this problem, you can do one of the following steps: 

  1. Do not build the entire solution. Instead, build each application separately.
  2. Configure Visual Studio to set the maximum number of parallel builds to one (1): Select Tools, Options. In the Options dialog, expand Projects and Solutions, select Build and Run. Set the maximum number of parallel project builds to 1.
  3. Add a dependency between the projects in the .sln file: In the solution explorer window, right click the solution, select Project Dependencies. In the Project Dependencies dialog, set one of the projects to be dependent on the other.
Platform:
Programming Language: