02-04-2010 06:14 AM
We want to port a project from CVi 7.0 to CVI 2009. Compiling the project fails with :
ALA_TK_Test.c - 20 errors, 1 warning
"WinNT.h"(5453,80) Redefinition of macro 'THREAD_BASE_PRIORITY_MIN'.
"WinNT.h"(5454,78) Redefinition of macro 'THREAD_BASE_PRIORITY_IDLE'.
"toolbox.h"(744,29) syntax error; found 'identifier' expecting ';'.
"toolbox.h"(782,68) Missing parameter type.
"toolbox.h"(782,86) syntax error; found '*' expecting ')'.
"toolbox.h"(783,68) Missing parameter type.
"toolbox.h"(783,86) syntax error; found 'identifier' expecting ')'.
"toolbox.h"(783,96) syntax error; found 'void' expecting '{'.
"toolbox.h"(783,114) Undefined size for 'void size_t'.
"toolbox.h"(783,114) syntax error; found 'identifier' expecting ';'.
"toolbox.h"(783,114) Undeclared identifier 'keyBufferSize'.
"toolbox.h"(783,129) Illegal expression.
"toolbox.h"(783,135) Undeclared identifier 'value'.
"toolbox.h"(783,149) syntax error; found 'identifier' expecting ';'.
"toolbox.h"(783,149) Undeclared identifier 'valueBufferSize'.
"toolbox.h"(783,164) syntax error; found ')' expecting ';'.
"toolbox.h"(783,164) Illegal statement termination.
"toolbox.h"(784,1) Unrecognized statement.
"toolbox.h"(784,9) Warning: Missing return value.
"toolbox.h"(784,9) syntax error; found '__stdcall' expecting '}'.
"toolbox.h"(784,68) Missing parameter type.
I'am wondering what happens here. Where does the first definition of 'THREAD_BASE_PRIORITY_MIN live and why doesn't it also hurt on CVI 7.0 ?
And toolbox.h uses the types intptr_t and size_t now , which the compiler doesn't seem to know. Is there an headerfile missing now ?
02-04-2010 11:09 AM
Hi Markus,
Whenever you include the Windows SDK in your project, you always need to make sure to include the Windows headers (usually "windows.h") before any CVI headers. This is the only way to handle conflicts that sometimes exist between the CVI headers and the Windows headers.
The THREAD_BASE_PRIORITY_* macros are an example of such a conflict. It wasn't a problem in CVI 7.0 because back then the definitions of these macros in the Windows headers were identical to the CVI definitions (in include\cvidef.h). But this changed in later versions of the SDK, and so now guards are needed in cvidef.h to avoid the conflict.
intptr_t is also defined in cvidef.h. This shouldn't pose a problem. I suspect that error will go away when you fix the other one.
Luis
02-05-2010 04:10 AM
09-26-2012 03:38 AM
"toolbox.h"(1211,58) syntax error; found 'identifier' expecting ')'.
"toolbox.h"(1211,84) Extraneous formal parameter specification.
"toolbox.h"(1212,61) Missing parameter type.
"toolbox.h"(1212,77) syntax error; found '*' expecting ')'.
"toolbox.h"(1214,57) syntax error; found 'identifier' expecting ')'.
"toolbox.h"(1214,81) syntax error; found ')' expecting ';'.
"toolbox.h"(1215,59) Missing parameter type.
"toolbox.h"(1215,75) syntax error; found '*' expecting ')'.
"toolbox.h"(1217,54) syntax error; found 'identifier' expecting ')'.
"toolbox.h"(1217,63) Extraneous formal parameter specification.
"toolbox.h"(1217,63) syntax error; found 'unsigned' expecting ';'.
"toolbox.h"(1217,88) syntax error; found ')' expecting ';'.
"toolbox.h"(1218,66) Missing parameter type.
"toolbox.h"(1218,82) syntax error; found '*' expecting ')'.
"toolbox.h"(1232,55) syntax error; found 'identifier' expecting ')'.
"toolbox.h"(1232,83) Extraneous formal parameter specification.
"toolbox.h"(1233,60) Missing parameter type.
"toolbox.h"(1233,76) syntax error; found '*' expecting ')'.
"tsutil.h"(24,14) Invalid use of 'typedef'.
"tsutil.h"(191,7) Invalid use of 'typedef'.
Hi....why i am getting these errors.i am not able to find it...please help me to solve this.
Is there an headerfile missing now ?