SCO unix下socket编程,编译报错 i386ld fatal: Symbol referencing errors.

我用c写有关socket的程序

包含了#include

 1<sys socket.h="">   
 2  
 3在程序里调用listenfd=socket(AF_INET,SOCK_STREAM,0);   
 4  
 5编译时报错:   
 6undefined first referenced   
 7symbol in file   
 8socket soc1.o   
 9i386ld fatal: Symbol referencing errors. No output written to a.out   
10  
11似乎不认socket这个函数 怎么回事呢?   
12\---------------------------------------------------------------   
13  
14在编译的时候要加-lsocket   
15例如:   
16cc -o test test.c -lsocket</sys>
Published At
Categories with 服务器类
Tagged with
comments powered by Disqus