The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Socket programming maracumbigo High Level Programming 4 02-10-2008 11:34 PM
Socket Programming arunviswanath High Level Programming 7 01-30-2007 12:18 PM
socket programming damn_bkb IP Networking 6 11-18-2006 11:10 PM
Need Help Regarding Socket Programming priya.vmr High Level Programming 1 11-06-2006 03:22 AM
Socket Programming joseph_shibu High Level Programming 1 11-05-2001 07:37 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-29-2004
Registered User
 

Join Date: Jun 2004
Location: Paris
Posts: 5
Socket Programming socket

Hello,

I actually try to make client-server program.
I'm using SCO OpenServer Release 5.0.0 and when I try to compile my code (by TELNET) I've got this error :
Quote:
Undefined first referenced
symbol in file
socket /usr/tmp/cca000Hf1.o
a.out: fatal error: Symbol referencing errors. No output written to a.out
I'm just using this simple code :
Quote:
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <stdio.h>

#define ADDRESS "192.168.0.191"

char *strs[3] = {"Message test - Socket"};

main()
{
char c;
FILE *fp;
int fromlen;
register int i, s, ns, len;
struct sockaddr_un saun, fsaun;

if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
{
perror("server: socket");
exit(1);
}
exit(0);
}
and I get the same error if I use :
Quote:
gcc serv.c
or
cc serv.c
or
c++ serv.c
If someone can help me,
Thanks
Reply With Quote
Forum Sponsor
  #2  
Old 06-29-2004
Registered User
 

Join Date: Jun 2004
Location: Paris
Posts: 5
I'm sorry....
I just search a bit more on the forum and I find something...

cc test.c -lsocket

and It works...

Last edited by soshell; 06-29-2004 at 04:51 AM.
Reply With Quote
  #3  
Old 06-29-2004
Registered User
 

Join Date: Jun 2004
Location: Paris
Posts: 5
Perhaps....I will need to send mail, send SMS, reboot computer (so using shell command), so I guess I will need a lot of librairies!

So thank you!!!
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:31 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0