Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation says #include vld.h must be after stdafx.h, but fatal error is thrown if I do #77

Open
CedricCicada opened this issue Feb 3, 2021 · 3 comments

Comments

@CedricCicada
Copy link

The vld.h file contains this:

#ifdef __AFXWIN_H__ #error[VLD COMPILE ERROR] '#include <vld.h>' should appear before '#include <afxwin.h>' in file stdafx.h #endif

But the documentation says this:

"In at least one C/C++ source file from your program, include the vld.h header file. It should not matter which file you add the include statement to. It also should not matter in what order the header is included in relation to other headers. The only exception is stdafx.h (or any other precompiled header). A precompiled header, such as stdafx.h, must always be the first header included in a source file, so vld.h must be included after any precompiled headers."

Please fix one or the other.

@RoyalPictou
Copy link

RoyalPictou commented Feb 3, 2021

To me, using precompiled headers is a mess. I omit them where I can as they lead to many errors, faults, mistakes and - it's OLD technology from Microsoft, which has helped in recent times to decrease compile times.

Eliminate it completly, if possible ... just a tip.

@CedricCicada
Copy link
Author

CedricCicada commented Feb 4, 2021 via email

@pgerell
Copy link

pgerell commented Apr 9, 2021

I have positive experiences from using precompiled headers. Reduces compile times a lot.
A long time ago they could be problematic. These days a correctly defined precompiled header rarely introduce any problem.

Note that afxwin.h has nothing to do with precompiled headers.
Likewise, stdafx.h has nothing to do with AFX (MFC). It's just the default name used by wizards in old versions of Visual Studio. Recent versions use the name pch.h instead.

There should be no conflict between precompiled headers and VLD in the same project.
Just make sure the precompiled header does not include afxwin.h.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants