[comp.protocols.tcp-ip] Problems with WIN/TCP v5.1...

garrett@oscar.ccm.udel.edu (07/19/90)

Greetings, all...  We have just had the latest version of WIN/TCP (v5.1)
installed here at our site and I finally decided to sit down and learn how to
use the library/system call interface for VAXC...

Before I get into the details, we have the software installed on a 785 running
VMS v4.7 and VAXC v2.4

I have been following the examples in the WIN/TCP Programming Guide...

I found example source code in the directory TWG$TCP:[NETDIST.TUTORIAL.EXAMPLE]
(SERV.C, and CLIENT.C)

When I tried compiling these programs, I found that evidently some #include
files appeared to be missing from their correct locations.  Among these files
were:

twg$tcp:[netdist.include.sys]types.h
twg$tcp:[netdist.include.sys]errno.h
twg$tcp:[netdist.include.sys]netdb.h

I looked all through the [netdist...] directory tree for these files and could
not find them.  I took a look on the directory tree of an older version of
WIN/TCP (v3.2) and found files with the same name (sys/types2.h in v3.2 was
identical to the same file in v5.1, so I assumed the rest would be the same.
Is this a bad assumption) so I copied them to the appropriate location in the
v5.1 directory tree.

After copying these files, I was able to compile CLIENT.C and SERV.C, but got
the following warning in the process:

        typedef long    size_t;
%CC-W-DUPDEFINITION, Duplicate definition of "size_t".
                At line number 41 in TWG$TCP:[NETDIST.INCLUDE.SYS]TYPES.H;1.

Is this a bad thing?

Now, on to the linkage part...

As was suggested in the "Compiling, Linking and Running Network Code" section
of the manual, I added the following definitions to my login.com file to
make the link steps a little easier:

$ define lnk$library sys$library:vaxcrtl.olb
$ define lnk$library_1 tcp:[netdist.lib]libnet.olb
$ define lnk$library_2 tcp:[netdist.lib]libnetacc.olb

and then linked the two programs:

$ link serv
$ link client

When I linked CLIENT, though I was informed of some undefined symbols:

%LINK-W-NUDFSYMS, 2 undefined symbols:
%LINK-I-UDFSYM,         _$EMUL
%LINK-I-UDFSYM,         _$MOVE

These symbols seem to be referenced extensively by modules SELECT, SEND,
RECEIVE, and WRITEV in LIBNETACC...

In fact, when you run the CLIENT program, it dies with an access violation in
the 1st library call (gethostbyname) in the program.

The SERV program is silent.  (I did a $run/det serv, as instructed by the
Programming Guide) The process it is in is still soundly sleeping, no real way
to know whether or not it is working until I can get the client part going.

Does anyone have any suggestions for me?  Is the problem because I copied the
OLD include files?  Maybe there's some special instructions for linking the
new stuff under VMS v4.7?  Maybe it's something else?  Thanks in advance for
any help y'all might be able to lend me here... All I want to do is get some
experience with writing client/server applications, and I can't even get
started yet... Grrr...  Take care, all...

+-------------------------------------+--------------------------------------+
| Joel J. Garrett, Research Associate |         Phone: (302)-451-2332        |
|   Center for Composite Materials    |   inet:  garrett@oscar.ccm.udel.edu  |
|       University of Delaware        |                - or -                |
|       Newark, Delaware 19716        |          garrett@udel.edu            |
+-------------------------------------+--------------------------------------+

imp@dancer.Solbourne.COM (Warner Losh) (07/19/90)

In article <25049@nigel.udel.EDU> garrett@oscar.ccm.udel.edu writes:
>I have been following the examples in the WIN/TCP Programming
>Guide...

The programming guide doesn't match reality in all cases.  The thing
that you need to know to get programs to link is there is only one
library called TWGLIB.  It replaces LIBNET and LIBNETACC.  These
libraries are for use only by Euncie.  There should have been stuff in
the release notes about this, but my memory here is a bit faded.

>After copying these files, I was able to compile CLIENT.C and SERV.C, but got
>the following warning in the process:
>
>        typedef long    size_t;
>%CC-W-DUPDEFINITION, Duplicate definition of "size_t".
>                At line number 41 in TWG$TCP:[NETDIST.INCLUDE.SYS]TYPES.H;1.
>
>Is this a bad thing?

No.  size_t gets redefined from an unsigned int to a signed int (since
VAX-C has int == long).  Unless you are dealing with very large
objects, this shouldn't be a problem.  The original definition is in
something like SYS$LIBRARY:TYPES.H or some other include VAX-C include
file.  If you remove it from [NETDIST.INCLUDE.SYS]TYPES.H, then the
error will go away.  You can also change it to "typedef unsigned int
size_t".

Also, you should be using the types.h file from
twg$tcp:[netdist.include.sys] off the 5.1 tape.  It is not in the VMS
4.x installation saveset due to an oversite.  You can get it out of
the "B" saveset (fullname WIN_TCP051.B I think).

>As was suggested in the "Compiling, Linking and Running Network Code" section
>of the manual, I added the following definitions to my login.com file to
>make the link steps a little easier:

This section is wrong.  The libraries that you use have changed in
release 5.1.  You should add the following to your login.com

$ define LNK$LIBRARY SYS$LIBRARY:VAXCRTL.OLB
$ define LNK$LIBRARY TWG$TCP:[NETDIST.LIB]TWGLIB.OLB

>%LINK-W-NUDFSYMS, 2 undefined symbols:
>%LINK-I-UDFSYM,         _$EMUL
>%LINK-I-UDFSYM,         _$MOVE

These routines are found in LIBNET, so if you list that after the
LIBNETACC (for a second time), you shouldn't get errors.  However, you
will be better off in the long run by using TWGLIB.

Try these suggestions.  They should help.  All of the above is from
memory, since I no longer work for TWG.
--
Warner Losh		imp@Solbourne.COM
Boycott Lotus.		#include <std/disclaimer>