Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3046

#include errors: how to avoid?

$
0
0
I get a slew of syntax errors starting in line 243 of <WinBase.h>.

The compiler underscores such typedefs as ULONG_PTR, DWORD, PVOID and HANDLE among others.

Presumably, <winbase.h> has a prerequisite header file that it is not #include'g itself :-(.

What am I missing?

PS: I tried changing the order of #include <WinBase.h>, to no avail.


The code is....

#include "stdafx.h"
#include <stdlib.h>
#include <time.h> // for time()
#include <WinBase.h> // for sleep()

int _tmain(int argc, char* argv[])
{
time_t st, et;
st = time();
sleep(2000);
et = time();
printf("%ld\n%ld\n%ld\n", st, et, et-st);
done:
printf("press Enter to terminate");
getchar();
return 0;
}


"stdafx.h" is (as provided by Visual C++)....

#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>


"targetver.h" is (as provided by Visual C++)....

#pragma once
#include <SDKDDKVer.h>

Viewing all articles
Browse latest Browse all 3046

Trending Articles