LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-06-2005, 01:27 AM   #1
taureanyang
LQ Newbie
 
Registered: Mar 2005
Posts: 10

Rep: Reputation: 0
differ between linux and solaris in socket programming


I have written a echo server and client on linux, and they run well.
But when I copy these files on solaris , and compiled them,
there come some errors. It said that " socket, accept , bind ,listen not defined" .
I have used "#include <sys/socket.h>" to import these functions.
Does these functions not be defined in sys/socket.h ?
Thanks
 
Old 07-06-2005, 02:02 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,492

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
You need to link with the network libraries, add these options to your command:
Code:
... -lnsl -lsocket
 
Old 07-06-2005, 03:27 AM   #3
taureanyang
LQ Newbie
 
Registered: Mar 2005
Posts: 10

Original Poster
Rep: Reputation: 0
Thank you jlliagre .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LINUX C an socket programming hasek Programming 5 06-12-2005 10:34 AM
Linux Socket Programming source code saied Programming 4 05-24-2005 02:18 AM
socket programming in linux ray5_83 Programming 4 11-18-2004 01:06 AM
Linux Socket Programming velan Programming 4 06-24-2004 04:03 AM
want help in socket programming valib4u *BSD 2 09-11-2003 11:17 PM


All times are GMT -5. The time now is 12:28 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration