Is it possible to add precompiled header for C++ in Visual Studio Code, and if so, how? Couldn't find info anywhere.
Asked
Active
Viewed 1,396 times
2
-
3visual studio code is a glorified text editor and has little to do with building code, how are you building your code? You need to add your precompiled header to the build system you are using – Alan Birtles Jul 04 '21 at 06:34
-
I'm using Code Runner extension to compile the code and compiler I'm using is MINGW. Also I'm using Windows. Is it possible to do it with Code Runner or is there another way around? – softcactus Jul 04 '21 at 06:44
-
1the you need to look up the code runner documentation, as far as I know it only supports compiling single source files? I doubt it has support for precompiled headers, there's probably not much benefit to using a precompiled header with a single file. If you want to start using more complex builds then use a proper build system like cmake which has [built in support for precompiled headers](https://cmake.org/cmake/help/git-stage/command/target_precompile_headers.html) – Alan Birtles Jul 04 '21 at 06:47
-
Code Runner is capable of running multiple source files. I might check CMake later, thanks! – softcactus Jul 04 '21 at 07:27