Share your knowledge at the LQ Wiki.
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, 01: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, 02:02 AM   #2
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Ubuntu/WSL
Posts: 9,785

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
You need to link with the network libraries, add these options to your command:
... -lnsl -lsocket
Old 07-06-2005, 03: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 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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:50 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
Open Source Consulting | Domain Registration