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

3

3

I just have a quick question. I've noticed that I don't have stdafx.h in my compiler(mingw32 on windows)

Am I supposed to have it? Or maybe is there a way to get around it?

Thanks for reading

EDIT: ok here is my current build log once I took out ALL of the includes of stdafx.h

http://pastebin.com/bczLr8xY

Horned answered 23/3, 2011 at 16:34 Comment(5)
yes im wondering why i dont have this even though its in this glm library i downloaded: 3dcodingtutorial.com/Working-with-3D-models/Getting-GLM.html i figured i had to compile it with my project, since i get a bunch of errors when making a static libHorned
and just like every other question, its downedHorned
im just gonna attempt taking the stdafx out...again...Horned
every other file was there, its those undefined errorsHorned
Either link "opengl32" or open a new question for the new issue you are having.Surmount
C
6

Read this wikipedia article. The paragraph I linked and the paragraph below it (mingw32 uses GCC).

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

Since stdafx.h contains the most common headers I would remove every instance of #include stdafx.h and try to compile. If you get compile errors that a certain function is missing, add the appropriate header. Rinse and repeat.

Chilpancingo answered 23/3, 2011 at 16:37 Comment(0)
L
3

No. Stdafx.h is created with MSVC++. It usually contains most common headers files. And Stdafx.h is included in every .cpp file in the beginning. It's precompiled header (if you've chosen so in the settings) created by MSVC++.

Linen answered 23/3, 2011 at 16:35 Comment(5)
ok then what should i do about this GLM library i got(made by nate robins and downloaded from here: 3dcodingtutorial.com/Working-with-3D-models/Getting-GLM.html and theres no reason to yell >->Horned
then why doesnt my project have it??Horned
@Horned : MinGW doesn't create it. So you don't have to worry. Include header files manually. Also MinGW is a compiler. Not an IDE. An IDE usually creates some common header files and source files which then is edited and modified by the programmers!Linen
well i thought it was the compiler that everyone wants to know about, in this case i use CodeBlocksHorned
@Molmasepic: No. As I said you don't have to worry about if it's not there. Just include the header files which you need manually. Everything should work fine then!Linen
H
1

To all: Using the pre compiled header file stdafx.h in the visual C++ always creates one or the other problem n case u have created a "Windows Console App" from Visual C++. The Solution to it is that, just create "Empty Project", rather than the pre-compiled windows console application. After creating the Empty project, create the source File. Write the business logic and add all the required resource and header files. Keep the external dependency files in the same directory in which your source code is: e.g., C:\Users\John\Documents\Visual Studio 2010\Projects\xyz.cpp\xyz.cpp. Finally add the source file to the global scope, that is add it to the "Empty Project" created already. It can be done by Clicking "File" on Visual Studio prompt and select the option of adding the source file to the project. Thanks and Regards: Rouf Khan

Helvetic answered 9/1, 2014 at 11:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.