The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
.
google unix.com



SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Use of functions amitrajvarma Shell Programming and Scripting 1 11-23-2007 06:52 AM
Where can I find Linux functions corresponding to the Solaris DDI? boyanov High Level Programming 3 06-28-2007 10:31 AM
functions in Raom Shell Programming and Scripting 6 07-21-2006 04:06 AM
FTP functions hzambra High Level Programming 3 05-03-2002 02:06 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-25-2008
f.ben.isaac f.ben.isaac is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 32
Are these C++ functions Available in SUN Solaris?

I tried to compile a socket programming code under SUN Solaris by using g++, i get the following errors:

Undefined first referenced
symbol in file
__xnet_connect /var/tmp//ccidZvCu.o
__xnet_socket /var/tmp//ccidZvCu.o
getaddrinfo /var/tmp//ccidZvCu.o
freeaddrinfo /var/tmp//ccidZvCu.o
gai_strerror /var/tmp//ccidZvCu.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status

Note: the program compiles under Linux - Ubuntu.

Any help? Where can i find the library? How can i link it to my code?
  #2 (permalink)  
Old 10-25-2008
jlliagre jlliagre is offline Forum Advisor  
ɹǝsn sıɹɐlosuǝdo
  
 

Join Date: Dec 2007
Location: Paris
Posts: 1,477
The best way to figure out if a function is available with Solaris is to look for a man page.

Eg:
Code:
man getaddrinfo

If there is one, it will give hints about the library to be used:


Code:
cc [flag ...] file ... -lsocket -lnsl [library ...]

  #3 (permalink)  
Old 10-25-2008
f.ben.isaac f.ben.isaac is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 32
Yes its there, i included the libraries, its still does not work:


cc [flag ...] file ... -lsocket -lnsl [library ...]
#include <sys/socket.h>
#include <netdb.h>
  #4 (permalink)  
Old 10-25-2008
jlliagre jlliagre is offline Forum Advisor  
ɹǝsn sıɹɐlosuǝdo
  
 

Join Date: Dec 2007
Location: Paris
Posts: 1,477
You do not include libraries, you include plain text include files.

Libraries are linked to using the -l flags.

Did you use them ?
  #5 (permalink)  
Old 10-25-2008
f.ben.isaac f.ben.isaac is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 32
no i didn't....I have never used them, i'm a newbie can you please guide me more?
  #6 (permalink)  
Old 10-25-2008
f.ben.isaac f.ben.isaac is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 32
I did this g++ fileName -lsocket -lnsl

Worked!

Thanks
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:25 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0