Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
3 ratings:
 3.33 out of 5     Rate this Document

Redeclaration Errors When Compiling a LabWindows/CVI Project

Primary Software: LabWindows/CVI Development Systems>>Full Development System
Primary Software Version: 8.1
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
When I try to compile my LabWindows/CVI application, I receive redeclaration errors as shown below:

"winnt.h"(219,21) syntax error;
found 'identifier' expecting ';'.
"winnt.h"(225,15) Redeclaration of 'WCHAR'.
"winnt.h"(225,15) syntax error;
found '*' expecting ';'. "
winnt.h"(225,15) Unrecognized declaration.

What's going on and how can I fix these errors?

Solution:
If you are getting a compile error saying that there is a "redeclaration" of some type, it most likely means that another header file you are including also has the same typedef in it as well.

Often times the redeclaration errors in LabWindows/CVI are caused by #including header files in an incorrect order. For example, you must include the Windows SDK include files before the LabWindows/CVI include files. This way, you avoid problems that arise from function name and typedef conflicts between the Windows SDK and the LabWindows/CVI libraries. The LabWindows/CVI include files contain special macros and conditional compilation to adjust for declarations in the SDK include files. Thus, LabWindows/CVI must process the SDK include files first, followed by the LabWindows/CVI include files.

Also make sure that you are not linking to other Windows SDK include directories through project-specific or non-specific include paths. To check this, select Options » Environment and then click on the Include Paths button. This will bring up the dialog which allows you to have project specific and general project include paths. If you are looking to other non-CVI Windows SDK include directories, remove them by selecting the Cut button.

Related Links:

Attachments:





Report Date: 08/09/2006
Last Updated: 01/25/2007
Document ID: 408FIPNM

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit