MSB8027: Two or more files with the name of ***. cpp will produce outputs to the same location .,
Link: http://www.setoreaustralia.com/msb8027-two-or-more-files-with-the-name-of-texture-cpp-will-produce-outputs-to-the-same-location/
Another "pleasure" of development in the VC ++ environment ". Although it seems that nothing can cause problems, directly Porting some * nix code will never run perfectly. When porting an AR system (spatial augmented reality system), we have two Texture. cpp (one for the real environment texture and the other for the virtual target texture) are located in different subdirectories, but VC ++ compiler does not like to accept this situation:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(942,5): warning MSB8027: Two or more files with the name of Texture.cpp will produce outputs to the same location. This can lead to an incorrect build result. The files involved are src\geometry\Texture.cpp, src\graphics\Texture.cpp.
The program will continue to compile, but at last there will always be errors when it contains the error file or access the error category!
In fact, this is not a new Bug. This problem occurs in the timeline provided by Microsoft Connect below, and it was originally planned to be solved in Visual Studio 2013 Update 1 (I am currently using Update 3, but it is not solved yet !) : Https://connect.microsoft.com/VisualStudio/feedback/details/797460/incorrect-warning-msb8027-reported-for-files-excluded-from-build
Solution
By default, all source files (object files) are output to the same directory when VC ++ compiles the source files, and the source files with the same name overwrite the previous object files with the same name. To solve this problem, you can set the output path to be similar to the source file path. The following operations are applicable to Visual Studio 2013 (Update 3:
Right-click the project and choose Properties> Configuration Properties> C/C ++> output file> object file name. Change $ (IntDir) to $ (IntDir)/% (RelativeDir) /.
After the configuration is complete, the output path of the compilation stage takes into account the source file path rather than the source file name.
Wish you success!