About stdafx.h missing in my compiler (mingw32 on windows)

I just have a quick question. I noticed that I do not have stdafx.h in my compiler (mingw32 on windows)

Should I have this? Or maybe there is a way around this?

thank you for reading

EDIT: ok here is my current build log after I took ALL from stdafx.h inclusions

http://pastebin.com/bczLr8xY

+1
source share
3 answers

Read this wikipedia article. The connected item is I and the paragraph below (mingw32 uses GCC).

http://en.wikipedia.org/wiki/Precompiled_header#stdafx.h

Since stdafx.h contains the most common headers, I delete each instance of #include stdafx.h and try to compile. If you get compilation errors that are missing from a particular function, add the appropriate header. Rinse and repeat.

+6
source

Not. Stdafx.h is created using MSVC ++. It usually contains the most common header files. And Stdafx.h included in every .cpp file at the beginning. This is a precompiled header (if you selected it in the settings) created by MSVC ++.

+3
source

Everyone: Using a file with the precompiled stdafx.h header in visual C ++ always creates one or the other problem, and you created the β€œWindows Console App” from Visual C ++. The solution to this is to simply create an "Empty Project" and not a pre-compiled Windows console application. After creating an empty project, create the source file. Write business logic and add all the necessary resource and header files. Store external dependency files in the same directory as your source code: for example, C: \ Users \ John \ Documents \ Visual Studio 2010 \ Projects \ xyz.cpp \ xyz.cpp. Finally, add the source file to the global area by adding it to the already created "Empty Project". You can do this by clicking File at the Visual Studio prompt and select the option to add the source file to the project. Thank you and welcome: Ruf Khan

+1
source

Source: https://habr.com/ru/post/894975/


All Articles