I want to know how can we precompile the header files like <iostream> and <algorithm> which do not end with .h ?
Earlier I was using the <bits/stdc++.h> library which I precompiled using g++ stdc++.h through terminal and was working fine. But since it is not supported everywhere so I want to use the standard headers in my c++ program and precompile those headers for faster compilation.
I have found the path and I was executing the normal g++ iostream, however I am getting a syntax error. I have tried searching for the issue but i'm not getting it. The official site had mentioned using -x flag but I still don't know how to use it as I'm new to C++ environment.
I have tried using -o flag for output file but the error is always the same.
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe:iostream:1: syntax error collect2.exe: error: ld returned 1 exit status
My intensions for doing this is just to decrease the compilation time.
GCC version
g++ (MinGW.org GCC Build-20200227-1) 9.2.0