LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

_FILETIME redeclaration

Hi,

 

I am getting a "redeclaration of '_FILETIME' error while compiling my code.  I use multiple machines and the same code compiles happily in all the machines I am using but in one, in which I get this redeclaration error from toolbox.h.

 

In toolbox.h I have the following

 

#ifndef _FILETIME_
#pragma pack(push)
#pragma pack(4)
typedef struct _FILETIME {
    unsigned long dwLowDateTime;
    unsigned long dwHighDateTime;
} FILETIME;
#pragma pack(pop)
#define _FILETIME_
#endif

 

and the code that is causing problems has the #include in the following order

 

#include <analysis.h>
#include "ke2400.h"
#include <userint.h>
#include "externals.h"
#include <cvirte.h>  
#include <rs232.h>

#include <ole2.h>
#include <utility.h>
#include <ansi_c.h>
#include <formatio.h>
#include <toolbox.h>

 

Despite having read the following thread

 

http://forums.ni.com/ni/board/message?board.id=180&message.id=44663&query.id=1328040#M44663

 

I still can't solve this issue and it seems strange that this happens only on 1 machine. This machine had Windows SP2 installed, whereas others had SP3, so I installed SP3 on the machine giving this error but the error is still there.

 

Thanks for your help! 

0 Kudos
Message 1 of 5
(3,853 Views)
hm, I can only guess: if the C code and the include files are all the same on all the computers, then may be the include paths of your CVI installation differ? Did you check that these are identical, too? (Options/Environment/Include Path)
0 Kudos
Message 2 of 5
(3,851 Views)

Hi,

 

after having gone carefully through all the include paths in both machines, I found out that the following path was present:

 

C:\Program Files\National Instruments\MeasurementStudio\CVI\sdk\include

 

this folder is present in the machine giving the error (i.e. the sdk package has been installed in this machine) whereas is not present in the machine not giving the error. If I look at the include paths in the machine not giving the error, the path above is labeled as "not found".

So I cut the path above and everything worked.

I think the sdk package was installed in the first place in order to have windows capabilities like playing sounds etc, so for the moment the issue is solved but what if I wanted to use the sdk package? why is the sdk package causing the redeclaration? 

0 Kudos
Message 3 of 5
(3,841 Views)

guessing again: may be it is the result of a previous installation of CVI? Or it might be because you have also installed MeasurementStudio?

 

In a clean install of CVI2009, this path is C:\Program Files\National Instruments\CVI2009\sdk\include... With this configuration, including this path does not cause problems (in my case)

0 Kudos
Message 4 of 5
(3,832 Views)

Wolfgang is probably right. That path looks like the default installation path for CVI 6.0, which installed a earlier version of the SDK. So it's not completely surprising that there are declaration conflicts if some .c file were to include headers from both versions.

 

Luis

0 Kudos
Message 5 of 5
(3,817 Views)