What is the most unobtrusive way to use precompiled headers in Visual C ++?

Let's say I have one project with A.cpp, B.cpp, C.ppp files and mapping header files (and them). C ++ files include system headers or headers from other modules.

I want to compile them into a library with command line actions (e.g. using Make) using 'cl', with a precompiled header function.

What are the steps I have to take? What are the command line switches?

+3
source share
3 answers

.cpp, , . stdafx.cpp.

  • .cpp, , - stdafx.cpp
  • .cpp
  • /Yc .cpp /Fp .pch
  • /Yu /Fp .pch # 3

, , .

0
  • stdafx.h, , .
  • stdafx.cpp, stdafx.h.
  • , stdafx.pch stdafx. {h, cpp}
  • stdafx.cpp /Yc
  • stdafx.pch(, )
  • '/FI stdafx.h/Yu' (' , #include "stdafx.h" PCH').
+1

, :

devenv solutionfile.sln/build [solutionconfig] [/project projectnameorfile [  /projectconfig name]]

, . .

PCH, , , , cpp, pch, .

0
source

Source: https://habr.com/ru/post/1720181/


All Articles