I am new to Ubuntu and trying to precompile the bits header for faster C++ compilation. On my system, the path to the header files is:
/usr/include/x86_64-linux-gnu/c++/11/bits
Listing the directory contents after navigating to the path shows the following: 
Current Sublime Text Build System
Here is my current Sublime Text build configuration:
{
"shell_cmd": "g++ -std=c++20 -O2 -Wall -Wextra -Wshadow -Wconversion -Wfloat-equal -Wno-unused-result -DLOCAL -include ~/.stdc++.pch -o '$$${file_path}/$$${file_base_name}' '$$${file}' && timeout 10s '$$${file_path}/$$${file_base_name}' \lt '$$${file_path}/in.txt' > '$$${file_path}/out.txt' 2 \gt '$$${file_path}/err.txt'",
"file_regex": "^(...*?):([0-9]+):([0-9]+): (.*)$",
"working_dir": "${file_path}",
"selector": "source.c++, source.cpp",
"variants": [
{
"name": "Run Only",
"shell_cmd": "timeout 10s '$$${file_path}/$$${file_base_name}' < '$$${file_path}/in.txt' \gt '$$${file_path}/out.txt' 2> '${file_path}/err.txt'"
},
{
"name": "Compile Only",
"shell_cmd": "g++ -std=c++20 -O2 -Wall -Wextra -Wshadow -Wconversion -Wfloat-equal -Wno-unused-result -DLOCAL -include ~/.stdc++.pch -o '$$${file_path}/$$${file_base_name}' '${file}'"
}
]
}
Errors Encountered
After using this build system, I received compilation errors as shown in the screenshot: 
Notes
- The build attempts to include a precompiled header
~/.stdc++.pch. - Compilation fails, possibly due to incorrect precompiled header setup or incompatible paths.
- I am looking for a proper way to precompile the
bitsheader in Ubuntu and integrate it with Sublime Text. - Code Link where i error








That's now how
-includeis supposed to work.~/projects/pchas an example.bitsdirectory in the above dir.mkdir ~/projects/pch/bitsstdc++.hfile into thebitsdir.cp /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h ~/projects/pch/bitscd ~/projects/pchpchdir).g++ ... -I. -x c++-header -c ./bits/stdc++.h. This will create a./bits/stdc++.h.gchfile. Replace...with the usual flags you use (excluding the-include ~/.stdc++.pchpart).-include ~/.stdc++.pchin your compilation commands with-I ~/projects/pch.Now,
#include <bits/stdc++.h>will prioritize~/projects/pch/bits/stdc++.hand end up using the PCH.You can test if it's working or not by running
g++ ... -I ~/projects/pch -H A.cpp.-Hwill print all the header files used. It's working if you see something like! /home/<your user>/projects/pch/bits/stdc++.h.gchin the command output.