Use Borland C++ 4.0 For Network Programming The easiest way to compile network programming project using Borland C++ (4.0 or above) is to compile and build the program in DOS environment. The following steps give you some ideas how it works. Before doing this, you have to determine where the BC binaries are stored. In the Academic Service Building labs, they are stored in m:\borland\bc4\bin. 1. Start the DOS prompt 2. At the DOS prompt, set the path properly by path=$path;m:\borland\bc4\bin 3. Either save from the Web browser, or from this file, the following makefile.bcc to a directory of your choice (typically you should put the network program and the makefile in the same directory). # begin of makefile.bcc # # Internetworking with TCP/IP, Volume III example code Makefile # # David L Stevens, Internetworking Research Group at Purdue # Tue Sep 17 19:40:42 EST 1991 # ## modified by X. Meng for CSCI6345, BC 5.02 9/27/1997 ## modified by X. Meng for CSCI4345/CSCI6345, BC 4.0 6/15/1999 CC = m:\borland\bc4\bin\bcc32 # this depends on where your BC compiler is LINK = $(CC) # BC doesn't have a separate LINK INCLUDE=-Im:\borland\bc4\include # this depends on where your BC compiler is DEFS = /DMT CFLAGS = $(DEFS) $(INCLUDE) HDR = SRC = tcpecho.cpp tcpechod.cpp tcplib.cpp OBJE = tcpecho.obj tcplib.obj OBJD = tcpechod.obj tcplib.obj all: tcpecho.exe tcpechod.exe tcpecho.exe: $(OBJE) $(LINK) $(OBJE) tcpechod.exe: $(OBJD) $(LINK) -WM $(OBJD) tcpecho.obj: tcpecho.cpp $(CC) $(CFLAGS) -c tcpecho.cpp tcpechod.obj: tcpechod.cpp $(CC) $(CFLAGS) -WM -c tcpechod.cpp tcplib.obj: tcplib.cpp $(CC) $(CFLAGS) -c tcplib.cpp clean: del *.bak del *.exe del *.obj # end of makefile.bcc 4. Type at the DOS prompt make -f makefile.bcc The program should be compiled and the executable should be generated. 5. Execute the server program e.g. tcpechod first, then on the same machine or on a different machine execute the client program, e.g. tcpecho Note that in the original tcpechod.cpp that I gave out, errno.h was not included in the source code. This didn't cause problem in VC++. But BC++ doesn't like this, so make sure the following line is in the server (e.g. tcpechod.cpp) program #include The newer version of the tcpechod.cpp has fixed this problem.