Share Precompiled Header with multiple projects

来源:互联网 发布:php 变量前加@ 编辑:程序博客网 时间:2024/05/17 22:47

 

1. Build one project which includes precompiled header firstly as master project ;

 

2. Delete all stdafx.h file in other projects;

 

3. Set Additional Include Directories ( Project Properties > Configuartion Properties > C/C++ > General)  to the folder of the master project so the compiler can find the master stdafx.h file;

 

4. Set Precompiled Header Output File ( C/C++ > Precompiled Headers ) to master project's file;

 

5. Make other projects depend on master project so it always get built first. To do it, you can right click project node ,and choose Project Dependencies.

原创粉丝点击