LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

redefinition issues

I am getting multiple errors like:

"winbase.h"(2645,6) Redeclaration of 'CVI_GetFileSize' previously declared at
utility.h:445.

Is there a switch to turn off this type of error?
0 Kudos
Message 1 of 9
(4,728 Views)
Some additional info:

I am getting a bunch of winbase.h errors.
for example:
"winbase.h"(3119,6) Redeclaration of 'CVI_GetSystemTime' previously declared at utility.h:335.

In addition I am getting a bunch of errors like these:
"winbase.h"(6006,28) Redefinition of macro 'CopyFile'.
0 Kudos
Message 2 of 9
(4,728 Views)
Rich,

There are some conflicts between the CVI libraries and the SDK: some functions have the same names.

The way to handle the problem is to always include windows.h *before* you include the CVI headers. This allows the CVI header files to detect the conflict and fix it.

Luis
NI
0 Kudos
Message 3 of 9
(4,728 Views)
Well I am now getting:

#ifndef _WCHAR_T_DEFINED
typedef unsigned short wchar_t;
#define _WCHAR_T_DEFINED

with this error:
"rpcndr.h"(172,31) Redeclaration of 'wchar_t'.

I have tried following #include with
#define _WCHAR_T_DEFINED

but this seems to have no effect. What do I do?
0 Kudos
Message 4 of 9
(4,728 Views)
Rich,

What you have included here is not enough for me to know why you are getting the error. You have attached the relevant lines from rpcndr.h, which is fine, but this compile error suggests that wchar_t is being defined, differently, by another header file included earlier. Do you know what that header file is?

What is the exact set of header files that you are including in this source file?

Luis
0 Kudos
Message 5 of 9
(4,728 Views)
Louis, I am down to 3 files with the error
"rpcndr.h"(172,31) Redeclaration of 'wchar_t'.

Now, I am not including rpcndr.h directly. I suspect that one of the includes that I do have includes something that includes that. Here is a listing of the includes from one of those three files:

#include "cstools.h"
#include "RECSTATS.h"
#include "SENSTATS.h"
#include "SUMSTATS.h"
#include "EPSTATS.h"
#include /* Needed if linking in external compiler; harmless otherwise */
#include
#include "ctademo.h"
#include "gatemain.h"
#include
#include "toolbox.h"
#include "vcedef.h"

#include "gate.h"
#include
#include "inifile.h"
#include "windows.h"
#include "winver.h"

#define UNDER_WIN95
//#include "cbn_.h"
#include
#define _TIME_T_DEFINED
#include
#include
#include "iisdn.h"
//#include "mb323def.h"
//#include "mb323msg.h"
#include "agmdef.h"
#include "agents.h"
#include "map.h"
#include
#include

#include "ice.h"

Is there some way to find out where in this mess whar_t is being defined (and where rpcndr.h, whatever the heck that is) is being included?
0 Kudos
Message 6 of 9
(4,728 Views)
You should use the source code browser (Tools>>Source Code Browser) to inspect your include file hierarchy. When the browser window comes up, type the name of the source file in the Indentifier/Filename box, then select "Included headers" from the middle column. You can then examine the tree in the column on the right. That should let you find the first place where rpcndr.h is being included. You will then need to find where else wchar_t is being defined.

Another way to debug include file problems is to use the #error directive liberally to see what section of code is being included when you compile a file. The preprocessor will stop at the first #error it finds, so you will see what is and is not being compiled (useful when there
are a lot of messy #ifdef's).

Finally, I would try copying the line that gives you the error ("typedef unsigned short wchar_t") to all sorts of places in the included headers to see where the cutoff point is: in other words, when does it go from a harmless typedef to a compile error?

Luis
0 Kudos
Message 7 of 9
(4,728 Views)
Under tools, Source Code Control is greyed out in my version of CVI 5.5.
0 Kudos
Message 8 of 9
(4,728 Views)
It's not Source Code Control, it's Source Code Browser. But this feature was only introduced back in version 6, so if your version is 5.5 you don't have it. I guess that leaves you with the other two suggestions.

Luis
0 Kudos
Message 9 of 9
(4,728 Views)