Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法让 Visual C++ 自动将项目目录中的所有源文件包含到项目中?我想在解决方案资源管理器中看到它们,并将它们包含在编译中。当您使用 git 时,无法这样做会成为一个问题。
我知道这是一个老问题,但我在谷歌搜索中偶然发现了它,所以我会为那些未来的谷歌人添加我的解决方案。
在项目文件中,您可以添加以下行:<Compile Include="**/*.hpp" />
<Compile Include="**/*.hpp" />
这会将解决方案下任何目录中的所有 c++ 头文件添加到项目中。如果您想更具体,可以指定目录而不是星号。