Is there a way to use pre-compiled headers in VC++ without requiring stdafx.h?

后端 未结 9 778
予麋鹿
予麋鹿 2020-12-05 16:20

I\'ve got a bunch of legacy code that I need to write unit tests for. It uses pre-compiled headers everywhere so almost all .cpp files have a dependecy on stdafx.h which is

9条回答
  •  没有蜡笔的小新
    2020-12-05 17:01

    I only use pre-compiled headers for the code that needs to include the afx___ stuff - usually just UI, which I don't unit-test. UI code handles UI and calls functions that do have unit-tests (though most don't currently due to the app being legacy).

    For the bulk of the code I don't use pre-compiled headers.

    G.

提交回复
热议问题