Usage of precompiled headers may significantly reduce compilation time, especially when applied to large header files, header files that include many other header files, or header files that are included in many translation units.
If you don't the compiler will use the default prototype for undeclared functions, which is: int functionName(int argument); So it will compile, and link if the functions are available. But you will have problems at runtime.
You don't need to compile header files. It doesn't actually do anything, so there's no point in trying to run it. However, it is a great way to check for typos and mistakes and bugs, so it'll be easier later.
In the Solution Explorer window right click on the *.c file(s) and select Properties. Go to C / C++ -> Precompiled Headers and set the Precompiled Header option to Not Using Precompiled Headers.
Also, unless you actually need precompiled headers, I'd say turn it off project-wide.
Another option would be to compile your C files as C++ and keep using the precompiled headers. To do that, right click on the project name (or each .c file name), and set C / C++ -> Advanced -> Compiles As to Compile as C++ code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With