LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

When compiling with Lab

windows/CVI 5.5, why do I get the following error: "Redeclaration of 'WCHAR'". It also claims that I redeclared 'LPWSTR' and redefinitions of macros MAKEINTRESOURCEA and MAKEINTRESOURCEW. These are all in winver.h, which aren't included in my source files.Labwindows CVI redeclaration Problem
0 Kudos
Message 1 of 4
(3,105 Views)
windows/CVI 5.5, why do I get the following error: "Redeclaration of 'WCHAR'". It also claims that I redeclared 'LPWSTR' and redefinitions of macros MAKEINTRESOURCEA and MAKEINTRESOURCEW. These are all in winver.h, which aren't included in my source files.Just a quick answer first, and if this don't help I'll think further.

It may be that the file is being included from within another header file, and not one necessarily within your project.

Or, WCHAR and LPWSTR maybe defined in another header file of a different name altogether.

If there a file guard at the top of the header file ?

#if !defined SOME_NAMED_FILE_GUARD
#define SOME_NAMED_FILE_GUARD


..here follows the header file stuff

..at the end of the header file,

#endif

This will prevent the header file from being actioned twice, though I suspect it may be the other problem I mentioned.

But, check the file guard first, if it don't have one it should (good practice), if it does then its the existance of WCHAR etc)

Let me know,

Chri
s
0 Kudos
Message 2 of 4
(3,105 Views)
windows/CVI 5.5, why do I get the following error: "Redeclaration of 'WCHAR'". It also claims that I redeclared 'LPWSTR' and redefinitions of macros MAKEINTRESOURCEA and MAKEINTRESOURCEW. These are all in winver.h, which aren't included in my source files.Thanks, but I figured out the problem this morning, the file winver.h was installed in both the C:\MeasurementStudio\cvi\bin and the C:\MeasurementStudio\cvi\sdk\include directories. So when I removed it from the C:\MeasurementStudio\cvi\bin directory my project compiled properly.
Thanks,
Scott
0 Kudos
Message 3 of 4
(3,105 Views)
windows/CVI 5.5, why do I get the following error: "Redeclaration of 'WCHAR'". It also claims that I redeclared 'LPWSTR' and redefinitions of macros MAKEINTRESOURCEA and MAKEINTRESOURCEW. These are all in winver.h, which aren't included in my source files.Scott..

Good to hear...

So CVI included the header because it was in the bin directory of CVI and then when it found the SDK one included that too.

Do you think that is something to do with the

#include "header.h"
and
#include

declarations ???

Just curious.

Without making an explicit reference to both header files (which you hadn't), I was curious as to how CVI picked up on it,

Anyway, glad you solved your problem, and thats another thing I've picked up about CVI,

Regards

Chris
0 Kudos
Message 4 of 4
(3,105 Views)