Questions tagged [precompiled-headers]

A precompiled header is a header file that has statically compiled but still separate from its final executable in order to speed up compilation of dependent files.

In C and C++, precompiled headers allow for quicker compilation times by keeping the definitions from a given header in an compiled state. This allows the compiler to quickly incorporate the header when a file dependent on the header is being compiled.

Rather than having to parse through code, precompiled headers allow the compiler to skip directly to a more intermediate state. For headers that are used frequently this can result in significant compile-time savings.

454 questions
0
votes
1 answer

Large number of QT warnings when using a precompiled headers approach

I have recently switched a project to making use of precompiled headers due to compilation becoming slow. Before doing so, it built without any significant warnings. However, after adding all the QT headers I use in my project (of which I use 40-50)…
oracle3001
  • 1,090
  • 19
  • 31
0
votes
2 answers

How can I rebuild precompiled headers in VS?

It was needed because I deleted my .idb file and the error message told me to rebuild the precompiled headers.
0
votes
1 answer

Forcibly included header not found

I'm trying to set up precompiled headers in a large C++ project compiled with GCC 5.4. There is a file "PrecompiledHeaders.h", which includes all the other relevant headers. I've added the compile flag -include PrecompiledHeaders.h, but when…
Bart van Heukelom
  • 43,244
  • 59
  • 186
  • 301
0
votes
1 answer

How check if header guard is defined

I have these files that were given to me to solve and I have some doubts about header guard. In testGuards.h, there is a define like __HEADER_GUILD_SAFEBOX__, but the #ifdef asks if __GUILD_SAFEBOX__ is defined, so I don't know if this #ifdef…
Alejoo
  • 13
  • 5
0
votes
1 answer

definition of variable in stdafx.cpp

I have visual studio solution which contains various of C++ projects. For simplicity there are two projects. One for .lib and another for .exe. Both project use precompiled header stdafx.h. But precompiled header is shared between projects. Recently…
elanius
  • 487
  • 2
  • 19
0
votes
1 answer

Using #using with precompiled headers in C++

Is here any possibility to use #using with precompiled headers in visual studio 2005 in C++? Now I am gettin g error: Error 10 fatal error C1190: managed targeted code requires a '/clr' option
user3053231
0
votes
1 answer

Original file name of precompiled header

Is it possible to extract original filename (filepath) and compilation language from precompiled header? As I understand it's possible for Clang using llvm-bcanalyzer (LLVM bit code analyzer). So, could anybody help me with GCC?
vromanik
  • 196
  • 1
  • 4
0
votes
2 answers

Compiling C++ (.cpp) into an .exe file

:) Help greatly appreciated. I am looking to convert a .cpp file to .exe. I've tried with (MingW) gcc and g++. I also tried to manually compile it in Visual Studio. Unfortunately these fail to compile (both on Linux and Windows) because the…
Lykias
  • 13
  • 1
  • 4
0
votes
1 answer

MSVC C2859 when using a different build configuration of another project as a library

I have a fairly large multi-project C++ solution in Visual Studio 2015. Some of the projects compile to static libraries which are used by other projects, and most of them use precompiled headers to speed up compilation. Each project also has…
bcrist
  • 1,520
  • 13
  • 25
0
votes
1 answer

Error : 'ClassName' does not name a type

I know the error is pretty self-explanatory but I can't seem to find the inner problem in my code.All seems fine to me.Anyway there are my header files : GList.h : #ifndef LIST_H_ #define LIST_H_ #include "GNode.h" class GList { GNode…
Alex R.
  • 459
  • 5
  • 16
0
votes
3 answers

How to prevent Visual C++ from creating stdafx.h?

I'm using Visual Studio 2015. I always uncheck "Precompiled header" whenever I create a new project, but Visual Studio still creates the file and adds it to my project. I've tried just creating an empty project, but that also gets rid of the…
Kash
  • 51
  • 1
  • 7
0
votes
1 answer

XCode compiles all source everytime

XCode compiles all source every time i build project and it takes a lot of time. Looks like precompiled headers don't work. It worked correct before i changed location of project. What shuold i do to make it work? UPD: it's fixed few minutes ago. I…
PDaria
  • 457
  • 10
  • 21
0
votes
0 answers

GCC Precompiled Headers, multiple build configurations and -I-

Setting up Precompiled Headers with GCC is problematic in the following situation: somefile.cpp and precompiledheader.h are in the same directory multiple build configurations are needed Multiple build configurations require multiple generated…
0
votes
1 answer

c++ automake precompiled header support on centos

The background about this question is: my project(C++ language) contains too many files, which including boost, thrift, zookeeper, etc. Now the compilation duration takes too long. As you know, Visual Studio supports precompiled headers, so as GCC.…
Roland Yim
  • 36
  • 6
0
votes
2 answers

Is it OK to make a stdfx.h file myself?

Now, I realized that I need a precompiled header for my project. However, at the beginning, I created my project as an empty project which doesn't have a stdfx.h header file. So, this is what I did: - I created a header file name stdfx.h - In that…
Stoatman
  • 758
  • 3
  • 9
  • 22