Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×

Блог пользователя Qualified

Автор Qualified, история, 4 года назад, По-английски

The title says it all...

  • Проголосовать: нравится
  • +10
  • Проголосовать: не нравится

»
4 года назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

First, navigate to the stdc++.h file. This will be located at a directory similar to C:\MinGW\lib\gcc\mingw32\6.3.0\include\c++\mingw32\bits. Right click while pressing Shift to open a Powershell/cmd window there. Run the command g++ -std=c++17 stdc++.h, to compile the header. Take care to use the same flags you used in your build system(i.e use c++14 in command if you have build up of c++14). Check to make sure that the stdc++.h.gch file was created in the directory. Also,use "bits/stdc++.h" instead of <bits/stdc++.h> in header

  • »
    »
    4 года назад, # ^ |
    Rev. 3   Проголосовать: нравится +1 Проголосовать: не нравится

    Thanks, man! This is so fast! BTW, <bits/stdc++.h> runs in the same time as "bits/stdc++.h" so what is the difference?

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Actually I have read in this blog Link,according to this "bits/stdc++.h" use precompiled headers whereas <bits/stdc++.h> doesn't. IDK what's actual mechanism happening but in my case "bits/stdc++.h" working very good so I recommend that.

      • »
        »
        »
        »
        4 года назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        'Take care to use the flags' what is this step mean ? And how can I be sure that I'm using the precompiled headers rajkumar62506

        • »
          »
          »
          »
          »
          4 года назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится

          1)take care of flags means which c++ version you are using.if you are using c++14 then run command will be g++ -std=c++14 stdc++.h. 2)This info you can find on google by reading few blogs,once I was searching about precompiling header I was found it but I was not understood.But I can easily detect it by huge difference in compiling time.

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится
  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    When I try to compile it using command prompt, I get this error "The term 'g++' is not recognized as the name of a cmdlet, function, script file...". Any solution?

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    I compiled the header, but .gch is not created. Any solution?

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

For Linux Users
For Windows Users

Then run this command g++ -std=c++17 stdc++.h in your terminal or cmd, it will create stdc++.h.gch file. That's all. It will boost your compile time 8x faster.