error C2040: 'hFlag' : 'void *' differs in levels of indirection from 'int'

A

Angus

I am using a global which is a void*

I have it defined in one file as:
void* hFlag;


and one other header file as:
extern void* hFlag;


But I get this compile error:


error C2040: 'hFlag' : 'void *' differs in levels of indirection from
'int'


I can't understand what the problem is. I have another global
variable which is not void* and that works ok. I assume void* is the
problem. How can I fix it?
 
R

Ron Natalie

Angus said:
error C2040: 'hFlag' : 'void *' differs in levels of indirection from
'int'


I can't understand what the problem is. I have another global
variable which is not void* and that works ok. I assume void* is the
problem. How can I fix it?
Somewhere you have hFlag defined as int, or it picked up some inmplicit
int declaration (not supposedly possible in C++).

Are you sure there's not an:
extern hFlag;
somewhere?
 
C

Clark S. Cox III

Angus said:
I am using a global which is a void*

I've already responded to your question in comp.lang.c. Please, either
learn to cross-post properly or do not cross-post at all. (BTW,
cross-posting between comp.lang.c and comp.lang.c++ is rarely
appropriate, as C and C++ are two different languages)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top