stdafx.h

Why does stdafx.h work the way it does?

Hi all.. As usual, when my brain's messing with something I can't figure out myself, I come to you guys for help :) This time I've been wondering why stdafx.h works the way it does? To my understanding it does 2 things: Includes standard headers which we might (?) use and which are rarely changed Work as a compiler-bookmark for when ...

What's with the "Afx" in StdAfx.h?

I'm just curious what Afx stands for. And what about Fx in FxCop? ...

How to handle stdafx.h in cross-platform code?

I have a Visual Studio C++ based program that uses pre-compiled headers (stdafx.h). Now we are porting the application to Linux using gcc 4.x. The question is how to handle pre-compiled header in both environments. I've googled but can not come to a conclusion. Obviously I want leave stdafx.h in Visual Studio since the code base is p...

Question about precompiled headers in Visual C++

If I put a header (a.h) into stdafx.h and that header includes another header (b.h) that is not mentioned in stdafx.h, will b.h be visited every time someone includes a.h or is it compiled in as part of a.h? If it is compiled into a.h, what happens when someone includes b.h directly? Will this be precompiled or not? My motivation for ...

Why am I unable to #ifdef stdafx.h?

Hello, I am trying to include 2 platform-specific stdafx.h files in my .cpp file, but the compiler is unhappy when I try to #ifdef it. #ifdef _WIN32 #include "stdafx.h" #elif _MAC #include "MAC/stdafx.h" #endif You may wonder why I am using stdafx.h in the Mac code, but that is not important at the moment :). When I try to compile...

Memory leaks detection while using Boost

Hello, I would like to get the memory leaks information using _CRTDBG_MAP_ALLOC, and especially the files and line numbers, but I don't get them at the end. I only get something like this: {130} normal block at 0x00695128, 16 bytes long. Data: <\ E Pi > 5C A5 45 01 02 00 00 00 01 00 00 00 E8 50 69 00 I've seen that th...

c++ fatal error c1083 project was fine before, what now?

I have a (com) c++ project, which uses a (.net) c++ dll. The project was compiling and running ok. Now, all I did was make changes to the dll, and I'm getting a fatal error c1083- cannot open include file stdafx.h - when recompiling my (com) project. What can this mean? ...

StdAfx + Header file - Order of inclusion in MFC application

I am using Visual Studio 2005. I created an MFC based console application named "StdAfx dependancy". The IDE created the following files for me. Resource.h StdAfx Dependancy.h stdafx.h StdAfx Dependancy.cpp stdafx.cpp I added another class CHelper with Helper.h and Helper.cpp as below. Helper.h: #pragma once class CHelper { public...

MFC - precompiled header and AFX_IMPORT_DATA

Hi, I had a project under MFC 7.0 and now I created new project under MFV 9.0. I copied all the files, did the relevant changes in generated files (Doc, view, resources etc.) and when I try to build to project, the compiler outputs the following error: Error 1 error C2146: syntax error : missing ';' before identifier 'CUserTools...

how do i shot stdafx.h?

I am using Visual Studio 2010 to make a 3D model in C++ and OpenGL. I started a project on my home pc, and then decided to put it in a repository, so that I could get the code for development on my laptop and not have to keep transferring files between the two computers (and also just to get some practice at using source control). The p...