Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to not #include <windows.h>

Using MSVC2008, 32bit on 64bit system.

I was once advised to never include windows.h as 'its a real monster and will slow down my compile times significantly'.

I tried leaving it out and obviously get compile errors. I included windef.h to define all the DWORDs etc, but I quickly come unstuck knowing what else to define to get the code to compile.

I now get:

2>c:\program files\microsoft sdks\windows\v7.0\include\winnt.h(6361) : error C2146: syntax error : missing ';' before identifier 'ContextRecord'
2>c:\program files\microsoft sdks\windows\v7.0\include\winnt.h(12983) : error C2065: 'PCONTEXT' : undeclared identifier

Can anyone suggest the right approach here?

Thanks

Simon

like image 689
sipickles Avatar asked Jun 14 '10 11:06

sipickles


People also ask

Why do I always worry so much?

Are you always waiting for disaster to strike or excessively worried about things such as health, money, family, work, or school? If so, you may have a type of anxiety disorder called generalized anxiety disorder (GAD). GAD can make daily life feel like a constant state of worry, fear, and dread.


1 Answers

Use precompiled headers to improve compile times, and include windows.h.

like image 122
Sjoerd Avatar answered Sep 18 '22 15:09

Sjoerd