0

This is part of my code in visual studio 2010. However I'm getting the "IntelliSense: identifier "GetTickCount" is undefined" from the compiler. I do not know how to fix it.

typedef enum {FALSE = 0, TRUE} BOOL;

int main(int argc, char* argv[]){
double current_Time;
current_Time = GetTickCount()/1000.0 - start/1000;
....

those are the includes I have in the code

 #include <stdio.h>
 #include <time.h>
 #include <math.h>
 #include <stdlib.h> 
 #include <conio.h>
answerSeeker
  • 2,692
  • 4
  • 38
  • 76
  • 1
    http://msdn.microsoft.com/en-us/library/windows/desktop/ms724408(v=vs.85).aspx says "include windows.h" – Blorgbeard Apr 16 '14 at 05:08
  • When I included "#include "windows.h" I was no longer able to use `typedef enum {FALSE = 0, TRUE} BOOL;` properly it acts like it doesn't recognize the expression and underlines it. I need my booleans for this code. – answerSeeker Apr 16 '14 at 05:13
  • The symbols `FALSE` and `TRUE` are probably already defined to `0` and `1`, which means your `enum` is expanded to `enum {0 = 0, 1} BOOL;`, which would be problematic. – R Sahu Apr 16 '14 at 05:19
  • Windows already defines `BOOL`, `TRUE`, and `FALSE`. Take a look at [this article from MSDN](http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751%28v=vs.85%29.aspx). – R Sahu Apr 16 '14 at 05:22
  • I changed it to `typedef enum {FALSE , TRUE} BOOL;` It stills underlines it in Visio when I have `#include "windows.h"` – answerSeeker Apr 16 '14 at 05:26
  • You can remove that line without affecting your code. – R Sahu Apr 16 '14 at 05:29
  • It does affect my code. I need the booleans for the rest of the code under. It's C code – answerSeeker Apr 16 '14 at 05:34
  • 1
    Can you get away with doing something different? For example: typedef enum{MY_FALSE, MY_TRUE} BOOLEAN; – Mahonri Moriancumer Apr 16 '14 at 05:41
  • why was it behaving like that though??? Now my program compiles perfectly. I'm pretty much done. Thank you all – answerSeeker Apr 16 '14 at 06:02

1 Answers1

3

include widows.h file in header..

naresh60
  • 74
  • 1
  • 7