LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Is "socket.h" available for LabWindows/CVI

Solved!
Go to solution

I'm attempting to use a third party API with LabWindows/CVI. I'm getting a compile error that indicates "socketaddr_in" is undefined. On Unix/Linux systems this parameter is defined in the "socket.h" include file. I searched my (Windows) system for "socket.h". Nothing is found. Do I have to purchase Visual Studio (or whatever it's called) just to get socket.h (or whatever it's called on Windows)?

 

I'm spoiled by having this kind of stuff immediately available at no charge on Linux.

 

0 Kudos
Message 1 of 4
(4,496 Views)
Look for winsock.h. It comes as part of the Windows SDK forCVI and should provide the same functionality. However there might be some naming differences like socketaddr_in becomes sockaddr_in in winsock.
0 Kudos
Message 2 of 4
(4,494 Views)

You're correct, I should have typed "sockadd_in" not "socketadd_in". Sorry.

 

What is "Windows SDK for CVI"? Is it a Microsoft product or an NI product? Should it have been installed when I installed LabWindows/CVI? Or did I miss a step?

 

I found a seemingly related installer in the following folder on my system. Is this the "Windows SDK for CVI" that you mentioned? I went ahead and ran it. Afterward  the "sockaddr_in" problem appears to be gone. I say "appears" to be gone because I've tried so many things that I'm not positive that I have the exact same setup as before. I'm so confused!

C:\National Instruments Downloads\NILWCVIFDS90\Parts\CVI\SDK\

 

Now the compiler is looking for "winsock2.h". Where do I get that?

 

0 Kudos
Message 3 of 4
(4,465 Views)
Solution
Accepted by topic author querty999

Querty99,

 

 When you installLabWindows/CVI you will have the option to install the interface to Win32 API. To get access to the header files you are looking for make sure to right click the Interface to Win32 API  and select Install this feature to a local drive (see the attached screenshot). If installed correctly you should see WinSock2.h in your C:\Program Files\National Instruments\<CVI Version>\sdk\include.

Richard S -- National Instruments -- (former) Applications Engineer -- Data Acquisition with TestStand
0 Kudos
Message 4 of 4
(4,431 Views)