C2065: 'FILETIME' : undeclared identifier

Hi ,
I am porting a code from unix to windows.
Using windows 7 -64 bit.
previously in unix code we were using clock_gettime.
To make it work on windows i did the below changes.

But on executing the code i am getting error:
-----------------------------

Tool.cpp
Tool.cpp(163) : error C2065: 'FILETIME' : undeclared identifier
Tool.cpp(163) : error C2059: syntax error : ')'
Tool.cpp(163) : error C3861: 'GetSystemTimeAsFileTime': identifier not found
Tool.cpp(173) : error C2039: 'LARGE_INTEGER' : is not a member of 'winLib'
Tool.cpp(173) : error C2065: 'LARGE_INTEGER' : undeclared identifier
Tool.cpp(173) : error C2059: syntax error : ')'
Tool.cpp(173) : error C3861: 'QueryPerformanceFrequency': identifier not found
Tool.cpp(176) : error C2039: 'LARGE_INTEGER' : is not a member of 'winLib'
Tool.cpp(176) : error C2065: 'LARGE_INTEGER' : undeclared identifier
Tool.cpp(176) : error C2059: syntax error : ')'
Tool.cpp(176) : error C3861: 'QueryPerformanceCounter': identifier not found
Tool.cpp(179) : error C2039: 'LARGE_INTEGER' : is not a member of 'winLib'
Tool.cpp(179) : error C2065: 'LARGE_INTEGER' : undeclared identifier
Tool.cpp(179) : error C2059: syntax error : ')'
Tool.cpp(179) : error C3861: 'QueryPerformanceCounter': identifier not found


---------------------------


sample code
-----------------------------
#include <iostream>
#include <fstream>
#include "pin.H"
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include<string>
#include "unistd.h" //
#include <fcntl.h>
#ifndef _WIN32
#include <sys/shm.h>
#include <sys/time.h>
#include <sys/resource.h>
#endif

#include <cstdlib>
#include <cstring>
#include "sched.h"//

#include <time.h>
#include <sys/timeb.h>
#include <pthread.h>
#include "IPCBase.h"

#include "shmem_ritu.h"
#include "filePacket.h"
#include "encoding.h"


void unix_time(struct timespec *spec)
{
__int64 wintime;
GetSystemTimeAsFileTime((FILETIME*)&wintime);
wintime -= w2ux; spec->tv_sec = wintime / exp7;
spec->tv_nsec = wintime % exp7 * 100;
}

int clock_gettime(int, timespec *spec)
{

static struct timespec startspec; static double ticks2nano;
static __int64 startticks, tps = 0; __int64 tmp, curticks;
QueryPerformanceFrequency((winLib::LARGE_INTEGER*)&tmp); //some strange system can
if (tps != tmp) {
tps = tmp; //init ~~ONCE //possibly change freq ?
QueryPerformanceCounter((winLib::LARGE_INTEGER*)&startticks);
unix_time(&startspec); ticks2nano = (double)exp9 / tps;
}
QueryPerformanceCounter((winLib::LARGE_INTEGER*)&curticks); curticks -= startticks;
spec->tv_sec = startspec.tv_sec + (curticks / tps);
spec->tv_nsec = startspec.tv_nsec + (double)(curticks % tps) * ticks2nano;
if (!(spec->tv_nsec < exp9)) { spec->tv_sec++; spec->tv_nsec -= exp9; }

return 0;
}

-----------------------------------------------------------


Please provide inputs to overcome this.

Thanks,
Kunal
Including <windows.h> should solve some errors.
I tried ...but now i am getting many errors like

C:\Program Files (x86)\Windows Kits\8.0\include\um\minwinbase.h(48) : error C2872: 'BOOL' : ambiguous symbol
could be 'C:\Program Files (x86)\Windows Kits\8.0\include\shared\minwindef.h(157) : int BOOL'
or 'D:/minor/windowsTool/source/include/pin/gen\types.TLH(47) : LEVEL_BASE::BOOL'
Topic archived. No new replies allowed.