10-11-2012 01:47 AM - edited 10-11-2012 01:48 AM
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
10-11-2012 04:45 PM
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,
10-11-2012 08:50 PM
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
10-12-2012 09:30 AM
Hi Jon,
I'm really glad to hear everything worked out!
Warm Regards,