Are these C++ functions Available in SUN Solaris?


 
Thread Tools Search this Thread
Operating Systems Solaris Are these C++ functions Available in SUN Solaris?
# 1  
Old 10-25-2008
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  
Old 10-25-2008
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  
Old 10-25-2008
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  
Old 10-25-2008
You do not include libraries, you include plain text include files.

Libraries are linked to using the -l flags.

Did you use them ?
# 5  
Old 10-25-2008
no i didn't....I have never used them, i'm a newbie can you please guide me more?
# 6  
Old 10-25-2008
I did this g++ fileName -lsocket -lnsl

Worked!

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to execute functions or initiate functions as command line parameters for below requirement?

I have 7 functions those need to be executed as command line inputs, I tried with below code it’s not executing function. If I run the ./script 2 then fun2 should execute , how to initiate that function I tried case and if else also, how to initiate function from command line if then... (8 Replies)
Discussion started by: saku
8 Replies

2. Solaris

Sun Solaris not able to ping Sun Solaris

I have a Sun Blade 2500 with SUN 5.9 OS installed. I can ping other machines(windowsXP/2003) from my SUN machines but not able to ping each other SUN machines which i have newly installed. (7 Replies)
Discussion started by: z_haseeb
7 Replies

3. Solaris

useful links and help resources for Sun's products and Sun's Solaris

Hi all, Those links might help anyone Knowledge base Video tutorials (0 Replies)
Discussion started by: h@foorsa.biz
0 Replies

4. Solaris

Sun Fire 280R Sun Solaris CRT/Monitor requirements

I am new to Sun. I brought Sun Fire 280R to practice UNIX. What are the requirements for the monitor/CRT? Will it burn out old non-Sun CRTs? Does it need LCD monitor? Thanks. (3 Replies)
Discussion started by: bramptonmt
3 Replies

5. Solaris

encryption & decryption functions in sun solaries

hi, is there any library functions available in sun solaries for encryption and decryption functions. regards suresh (1 Reply)
Discussion started by: suresh_rtp
1 Replies

6. UNIX for Dummies Questions & Answers

Sun Solaris 10: How do I create a bootup disc? The Sun website confuses me

Hey there, I am starting a Computer Science Foundation year at the end of this month and am trying to get a little bit ahead of the game. I have always wanted to learn Unix and am currently struggling with creating a boot disc to run Solaris (I have chosen to study this) from as opposed to... (0 Replies)
Discussion started by: Jupiter
0 Replies

7. Programming

Where can I find Linux functions corresponding to the Solaris DDI?

Hello, I'm not sure whether this thread is in the right subforum, if it isn't please excuse me. So, here's my question - right now I'm trying to port a Solaris device driver for a custom piece of hardware to Linux (2.6.15), and I'm having some troubles finding the proper corresponding... (3 Replies)
Discussion started by: boyanov
3 Replies

8. Solaris

Sun Solaris Sun Java Desktop

Ok I a n00b, not gunna hide it so here goes - Sun Solaris, V.10 i386 - during the setup, I can choose a screen resolution that looks great with 65k colors and all. However, when all is said and done 4 disks and a reboot later, I get hanious 640x480 @ 256 only. If I choose the Sun Java Desktop... (20 Replies)
Discussion started by: Spooky
20 Replies
Login or Register to Ask a Question