Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 07-06-2005, 02:27 AM   #1
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 ?
Old 07-06-2005, 03:02 AM   #2
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.3, Oracle Linux, Mint
Posts: 9,669

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

Original Poster
Rep: Reputation: 0
Thank you jlliagre .


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 11:34 AM
Linux Socket Programming source code saied Programming 4 05-24-2005 03:18 AM
socket programming in linux ray5_83 Programming 4 11-18-2004 02:06 AM
Linux Socket Programming velan Programming 4 06-24-2004 05:03 AM
want help in socket programming valib4u *BSD 2 09-12-2003 12:17 AM

All times are GMT -5. The time now is 11:13 AM.

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