More <windoows.h> oddities.
I have a third project that is also a static libraary. This library has a VT100 class.
The pch.h file is as shown below. The pch.cpp file compiles without error.
Yet, in the VT100 class all Windows references are undefined even though the
#include <windows.h> is at line 4 of the pch.h file.
I add #include <windows.h> to the front of the VT100 class and it compiles fine.
It's as if the the #include <windows.h> is missing from the pch.h file.
I've tried cleaning and rescanning, but neither makes any difference.
This was working at one point.
lib3/pch.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <Windows.h>
// STL
#include <bitset>
#include <deque>
#include <exception>
#include <forward_list>
#include <fstream>
#include <iostream>
#include <random>
#include <set>
#include <string>
#include <sstream>
#include <streambuf>
| |
lib3/pch.cpp
Front of VT100.cpp:
1 2 3
|
#include "pch.h"
#include "lib3.h"
using namespace std;
| |
Front of VT100.h (included from lib3.h):
1 2 3 4 5 6
|
#pragma once
// The following two lines are necessary because the #include <windows.h>
// in pch.h is being ignored.
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <Windows.h>
| |