1
votes

Not sure why this is occurring for me... It says on line 72 " error C4430: missing type specifier - int assumed. Note: C++ does not support default-int "

Now, I'm thinking it's to do will my BOOL? Although I'm not sure, please can you help?

Line 72

static bCapture = false;

bCapure is underlined with the mouse over error off "static ERROR: Explicit type is missing ('int' assumed)

4
you forgot the type of the variable, 'static bool bcapture = false'alexbuisson

4 Answers

6
votes

Because you haven't declared the type of your static variable.

You have to use :

static bool bCapture = false;
//     ^^^^

static is not a type, it is a storage duration specifier :

1
votes

"Not sure why this is occurring for me." - because you haven't declared the type of your variable. static is not a type, it's a storage duration specifier. What you want is static bool bCapture = false;.

0
votes

static bCapture = false is not valid because you do not specify a type for bCapture(see below)). Since C++ is a strictly typed language, implicitly guessing the type from your assignment is not allowed. Consider this:

static a = 3; // is a int or some other integral type?
              // or maybe even a class with non-explicit
              // conversion constructor?

Use

static bool bCapture = false;

instead.


Since C++11 it is possible to let the compiler deduce the type of a variable, but you still have to explicitly tell it to do so. So it would be

auto f = false;
0
votes

You haven't declared type of bCapture - static is not a type.

Do it as

static bool bCapture = false;

Static

When modifying a variable, the static keyword specifies that the variable has static duration (it is allocated when the program begins and deallocated when the program ends) and initializes it to 0 unless another value is specified. When modifying a variable or function at file scope, the static keyword specifies that the variable or function has internal linkage (its name is not visible from outside the file in which it is declared).

Source & more detail: http://msdn.microsoft.com/en-us/library/s1sb61xd(v=vs.80).aspx