LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

problem #ifndef _WIN64 into excelreport.c

I just add the source files excelreport.c from CVI2012\toolslib and i have a "duplicate case label" error detected into my files at the line 2313 and 2320.

 case VAL_INTEGER:
#ifndef _WIN64
					case VAL_INTPTR_T:
#endif
                        errChk (GetTableCellVal (panel, control, cell, &intVal));
                        __caErrChk (CA_VariantSetInt (&SetValueV, intVal));
                        break;
                    case VAL_UNSIGNED_INTEGER:
#ifndef _WIN64
					case VAL_UINTPTR_T:
#endif
                        errChk (GetTableCellVal (panel, control, cell, &uintVal));
                        __caErrChk (CA_VariantSetUInt (&SetValueV, uintVal));
                        break;
                    case VAL_64BIT_INTEGER:
#ifdef _WIN64
					case VAL_INTPTR_T:
#endif
                       errChk (GetTableCellVal (panel, control, cell, &int64Val));
                        __caErrChk (CA_VariantSetLongLong (&SetValueV, int64Val));
                        break;
                    case VAL_UNSIGNED_64BIT_INTEGER:
#ifdef _WIN64
					case VAL_UINTPTR_T:
#endif
                        errChk (GetTableCellVal (panel, control, cell, &uint64Val));
                        __caErrChk (CA_VariantSetULongLong (&SetValueV, uint64Val));
                        break;

 the duplicate problem take it's origine from the #ifndef _WIN64, my program don't see it and return the duplicate case label error.

 

In what case the #ifndef or the #ifdef don't be use.

 

I have a 32bit computer with Win7 OS

0 Kudos
Message 1 of 3
(4,140 Views)

Hello GuiFi!

 

Your project build settings or your precompiled headers might have some defines set that cause the preprocessor to generate the duplicated switch cases in excelreport.c. Have you verified this? I'm asking this question, because it's highly likely that your project defines influence this behavior, because adding excelreport to a simple project (e.g. simple User Interface Application generated from template) doesn't cause this symptom.

0 Kudos
Message 2 of 3
(4,113 Views)

Are you possibly mixing the 2009 or 2010 version of userint.h with the 2012 version of excelreport.c? Versions 2009 and 2010 of CVI defined VAL_INTPTR_T, for example, in terms of VAL_INTEGER or VAL_64BIT_INTEGER. And so, if you are inadvertently including the 2009 or 2010 version of userint.h in the compilation of the 2012 or later version of excelreport.c, you could run into this error.

 

Luis

0 Kudos
Message 3 of 3
(4,091 Views)