I have the following line of code in my program –
typedef GROUP ACE_SOCK_GROUP;
That gives the following warnings and errors –
Warning 181 warning C4091: ‘typedef ‘ : ignored on left of ‘int’ when no variable is declared
Error 182 error C2143: syntax error : missing ‘;’ before ‘constant’
Error 183 error C2059: syntax error : ‘constant’
The definition of GROUP is given in another file that is included by my program as –
typedef unsigned int GROUP;
- What does ‘constant’ here refer to?
- What could be causing the error?
- What is the warning indicating
I am using Visual Studio 2008 and found the definition of GROUP using the F12 function
The code is correct.
You’re forgetting to include the file where
GROUPis defined.You can try a simple test to confirm this is the issue:
If this compiles, and it will, that means that the previous definition of
GROUPis not seen. You need to include the file with the definition before definingACE_SOCK_GROUP.