Hi.
I have a project (multiple header and source files) that was written in C, in unix. I made a new C++ project in MSVS 2005 (blank project), and am trying to simply copy the C code to my new C++ project. I thought the main problem I'd face would be finding the equivalent libraries for windows, however, I ran into another issue.
I get the following error:
error C2036: 'void *' : unknown size
The line in question:
The entire function:
There are other lines generating the same error, but I assume if I solve one, I can solve the rest. The original C code compiles just fine with Cygwin using gcc, and the only addition I made when porting it to my C++ project is #include <windows.h> for UINT. Oh, I also changed all uint declerations to UINT.
How come the code compiles fine, but when I port it, it doesn't? What do I need to fix in order for the code to simply compile?
Thank you for any assistance!
I have a project (multiple header and source files) that was written in C, in unix. I made a new C++ project in MSVS 2005 (blank project), and am trying to simply copy the C code to my new C++ project. I thought the main problem I'd face would be finding the equivalent libraries for windows, however, I ran into another issue.
I get the following error:
error C2036: 'void *' : unknown size
The line in question:
Code:
if(v->cmp(k, v->table + i * v->elem_size) == 0)
Code:
void *vfind(VECTOR *v, void *k)
{
UINT i;
#if 0 /* bsearch is handing NULL pointers to v->cmp */
return (void*)bsearch(k, v->table, v->elem_count, v->elem_size, v->cmp);
#endif
for(i = 0; i < v->elem_count; i++)
{
if(v->cmp(k, v->table + i * v->elem_size) == 0)
{
return v->table + i * v->elem_size;
}
}
return NULL;
}
How come the code compiles fine, but when I port it, it doesn't? What do I need to fix in order for the code to simply compile?
Thank you for any assistance!
Comment