LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

MSTcpIP.h errors in CVI 2012

Hi 

I have been using LabWindos CVI 8.1 and I am now looking into upgrading to 2012, so i have downloaded the trial version from the NI website and installed it. 
When i open and go to compile my project which uses the Winsock2 library in CVI 2012 i get some stange errors inside mstcpip.h.

"MSTcpIP.h"(331,1) syntax error; found 'identifier' expecting ';'. 

 

#if (NTDDI_VERSION >= NTDDI_WIN2KSP1)
MSTCPIP_INLINE
BOOLEAN
IN4_ADDR_EQUAL(__in CONST IN_ADDR *a, __in CONST IN_ADDR *b)
{
    return (BOOLEAN)(a->s_addr == b->s_addr);
}

 

it is happening on the 3rd line which reads just BOOLEAN 

which has been defined by this code in WinNT.h

typedef BYTE BOOLEAN;
typedef BOOLEAN *PBOOLEAN;

 

where BYTE is defined in WinDef.h

typedef unsigned char       BYTE;   

 


I do have a typedef unsigned char Boolean; in my code but i don't think that should be a problem as C is case sensative. 

Any help would be greatly apreciated

 

Thanx

-Jon

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

Hi TheMann,

 

Can you verify whether you are including the windows.h header file before the MSTcpIP.h header file is included?

 

If you are not calling #Include <windows.h> before this header, please rearrange your #Include calls so that #Include <windows.h> comes before #Include <mstcpip.h>.

 

Please let me know if this helps.

 

Regards,

Daniel Dorroh
National Instruments
0 Kudos
Message 2 of 4
(3,347 Views)

Hi Daniel,

 

Thanx for the reply 

 

I had my includes in the following order

 

#include <stdlib.h>
#include <stdio.h>
#include <winsock2.h>
#include <windows.h>
#include <MSTcpIP.h> 

#include <Iphlpapi.h>

 


//#include "C:\Program Files (x86)\National Instruments\CVI81\sdk\include\MSTcpIP.h"

 

If i directly link to the old CVI8.1 file it compiles fine without errors.  

 

I just rearanged the includes into this order 

 

#include <windows.h>
#include <MSTcpIP.h>

#include <stdlib.h>
#include <stdio.h>

#include <winsock2.h>

#include <Iphlpapi.h>

 

And now it compiles fine, not really sure why but as long as it works 🙂 

 

Thank you very much for your help,

-Jon

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

Hi Jon,

 

I'm really glad to hear everything worked out!

 

Warm Regards,

Daniel Dorroh
National Instruments
0 Kudos
Message 4 of 4
(3,332 Views)