Visual Studio warning about copies of files with different contents

前端 未结 13 834
北恋
北恋 2021-02-05 00:05

When I go to debug my C++ project in Visual Studio, up pops a little warning dialogue box that tells me:

A copy of datum.h was found in
c:/users/brad/desktop/sou         


        
13条回答
  •  佛祖请我去吃肉
    2021-02-05 00:37

    Just encountered this. In my case, one of my .h files contained implementation (a class with static methods), which was #included by one of my .cpp files, but the Project Settings were also telling Visual Studio to compile the .h file.

    I manually edited both the .vcxproj and .vcxproj.filters project files, moving the .h file from the ItemGroup to the ItemGroup.

    This did the trick for me; I never saw the "A copy of...is different from..." pop-up again.
    (Note that this was after I had thoroughly failed in attempts to get to work.)

提交回复
热议问题