This page contains some "hints" for compiling network programming under Unix and MS Windows.
You should have linked programs on a Unix computer, such as bulldog, in CSCI 202. However, just in case you've forgotten, I'll give you an example command for compiling and linking a C program.
This example assumes that the program source is stored in netprog.c and that the executable should be stored in netprog.
You will need to use library functions of the socket API, such as connect and gethostbyname, in this class. Before using a routines for the first time, you should look its man page, but typing a command similar to:
The man pages will give you three important pieces of information.
On Compaq Tru64 Unix (formerly know as Digital Unix) computers this information will be given in the LIBRARY section:
If you are compiling programs on a Unix computer, you really ought to be using Make. If you don't know how to use Make, you should get a good Unix reference. Example Makefiles for both Solaris and Compaq Tru64 Unix can be found with the following links:
The Visual C++ development environment is not an easy one to master. Hopefully, you have already compiled programs using Visual C++ in CSCI 201. If you haven't, you really need to check out some of the early CSCI 201 labs.
In order to run Windows programs that use the Winsock interface, you must include a Winsock library into your project. I included the library stored in C:\Program Files\Microsoft Visual Studio\VC98\Lib\Wsock32.lib when I compiled my Winsock applications. I suspect the smarter approach would be to include one of the Winsock dynamic link libraries (dll's), but I never mastered that trick. If you do figure out how to use the Winsock dll, please tell me the secret.
Back to the CSCI 363 homework page
Back to the CSCI 363 home page