Join 132,209 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 921 people online right now. Registration is fast and FREE... Join Now!
name.toLower(); for (PDNS_RECORD p = rr; p != NULL; p = p->pNext) { if (p->wType != DNS_QUERY_SRV || QString((char *) p->pName).toLower() != name) continue;
These are creating macros which are blank -- so what happens is the preprocessor makes your typedef lines look like this: typedef DNS_STATUS WINAPI (*)(PCSTR, WORD, DWORD, PIP4_ARRAY, PDNS_RECORD *, PVOID *);
ok... I did a few more tests, and so far I am not able to reproduce your error.
my thinking is that there is a syntax error somewhere before the (*DNS_QUERY)... there is a good chance that this is caused by a macro (pesky things).
I was going to say make sure that DNS_QUERY was not defined elsewhere, but the error, "'DNS_QUERY' : undeclared identifier" indicates that it is not a macro (unless it is a macro that contains its own name).
I was going to say add in:
CODE
#ifdef DNS_QUERY #warning DNS_QUERY is already defined. #endif
befor the typedef, but I am pretty sure that it is not already defined.
The other macros are all defined in windns.h or windows.h... ummmph
QUOTE
In your post you olso mention that 'typedef', I've both removed the orginals and place the one there and added the four define's you asked to rem out.
so you added in the foo typedef and got those errors?
name.toLower(); for (PDNS_RECORD p = rr; p != NULL; p = p->pNext) { if (p->wType != DNS_QUERY_SRV || QString((char *) p->pName).toLower() != name) continue;
Well when I was talking about removing the headers I was only talking about the little example I gave, not your program (which obviously needs these headers to compile).
This is a syntax error... you don't give a name to the typedef (i.e. the function_name is blank): typedef DNS_STATUS WINAPI (*)(PCSTR, WORD, DWORD, PIP4_ARRAY, PDNS_RECORD *, PVOID *)
no we want to keep the original source. We just want to trouble shoot the syntax. The best thing to do is to simplify the file as much as possible (take out eveything that we can and leave in only the parts we are trouble shooting).
The syntax that you are using to define your function pointers SEEMS to be correct -- so my guess is that the error is caused either by an errant macro (which happens), or with a syntax error in one of the header files.
generally speaking we try to work out such problems by starting at the top and working our way down (a single syntax error at the top can lead the compiler to report all sorts of errors (which are not really errors) farther down in the file... so generally I start with the first error found and work my way down. We are working on getting rid of the error in the typedef lines.
SO, to attempt to work this out I would try commenting out everything but the two typedefs and the includes and see if the error still occurs. -- IF IT STILL occurs then comment out the other includes (trying to leave in windows.h and windns.h).
Simplify as much as you can, then build back up the original file.