Question and Answer Database FAQ503C.txt Winsock and 16-bit applications Category :Windows API Platform :Windows 3.1 Product : BC++4.5x BC++5.x TC++Win4.5 Question: I have Borland C++ 4.52. If I write a program that includesin Win32, I dont have any problems. The project automatically finds all the functions defined in the header file. If I use the exact same project, but change the target to Windows 3.x(16bit), and I try to recompile, I get undefined function errors when linking. Additionally, there is no bc45\libs\winsock.lib. I finally got the program to work in 16bit mode with a 3rd party winsock.lib. What am I missing here? What is the difference between the 16 and 32 bit libs that I dont understand? Why is there no Winsock.lib and why do I have to include it in the 16 bit and not the 32 bit? Answer: Winsock is provided by Microsoft as part of the WIN9x and WINNT operating systems. As such, it is automatically linked in when you build a WIN32 app. It is not, however, part of Windows 3.11 or WFW so you must provide the library yourself when you build a 16 bit app. You can use IMPLIB to make an import library for winsock.dll and then include the import library in your project. 7/2/98 10:32:32 AM
Last Modified: 01-SEP-99