🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: cn.bbs.comp.program
3 messages
3 total messages Started by Wangjun Tue, 06 Jan 1998 00:00
һ��SCO UNIX�±������
#2257
Author: Wangjun
Date: Tue, 06 Jan 1998 00:00
61 lines
2047 bytes
����SCO-UNIX��cc���³��������server.o, �����ܵõ�ִ�д��롣
��ϵͳ���Ѱ�װ��TCP/IP��������������λ��̡�
#cc server.c
undefined symbol           first referenced
  bind                        server.o
  bcopy                       server.o
   .                           .
   .                           .
   .                           . 
  accept                      server.o

ld fatal: Symbol referencing errors No output written to a.out


/*Server.c */
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <string.h>

#define PORT (u_short)10000 
#define BUF_LEN 100
char hostname[]="wjsystem";
char buf[BUF_LEN];

main()
{struct hostent *myhost;
 struct sockaddr_in me;
 int s_waiting,s;
 
 myhost=gethostbyname(hostname);
 bzero((char *)&me,sizeof(me));
 me.sin_family=AF_INET;
 me.sin_port=PORT;
 bcopy(myhost->h_addr,(char *)&me.sin_addr,myhost->h_length);
 
 s_waiting=socket(AF_INET,SOCK_STREAM,0);
 bind(s_waiting,&me,sizeof(me));

 listen(s_waiting,1);
 s=accept(s_waiting,NULL,NULL);
 close(s_waiting);
 write(1,"Wait!\n",6);
 do
  {
   int n;
   n=read(0,buf,BUF_LEN);
   write(s,buf,n);
   n=read(s,buf,BUF_LEN);
   write(1,buf,n);
   }
  while (strncmp(buf,"quit",4)!=0);
 close(s);
}
   
------------------------------------
лл��
wangjun@public.hf.ah.cn
Re: һ��SCO UNIX�±������
#2081
Author: beck
Date: Sun, 25 Jan 1998 00:00
7 lines
693 bytes


> ����SCO-UNIX��cc���³��������server.o, �����ܵõ�ִ�д��롣
> ��ϵͳ���Ѱ�װ��TCP/IP��������������λ��̡�
> #cc server.c
    cc server.c -lsocket
Re: һ��SCO UNIX�±������
#2091
Author: Bula Zhang
Date: Tue, 03 Feb 1998 00:00
11 lines
945 bytes
Ӧ����cc -o server server.c -lsocket
���ܵõ�server�����ִ���ļ�.

beck wrote in message <01bd2737$4eb967a0$LocalHost@pentium>...
>
>
>> ����SCO-UNIX��cc���³��������server.o, �����ܵõ�ִ�д��롣
>> ��ϵͳ���Ѱ�װ��TCP/IP��������������λ��̡�
>> #cc server.c
>    cc server.c -lsocket
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads