Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fatal linking error in C++ on Unix 1

Status
Not open for further replies.

ritass

Programmer
Sep 20, 2005
2
US
Hi

I am getting following fatal linking error when I try to link my program. ( it compiles fine )

Undefined first referenced
symbol in file
recv /var/tmp//ccjyalLq.o
send /var/tmp//ccjyalLq.o
__xnet_connect /var/tmp//ccjyalLq.o
getservbyname /var/tmp//ccjyalLq.o
__xnet_sendto /var/tmp//ccjyalLq.o
__xnet_socket /var/tmp//ccjyalLq.o
getsockname /var/tmp//ccjyalLq.o
accept /var/tmp//ccjyalLq.o
listen /var/tmp//ccjyalLq.o
gethostbyname /var/tmp//ccjyalLq.o
setsockopt /var/tmp//ccjyalLq.o
getpeername /var/tmp//ccjyalLq.o
recvfrom /var/tmp//ccjyalLq.o
inet_addr /var/tmp//ccjyalLq.o
inet_ntoa /var/tmp//ccjyalLq.o
__xnet_bind /var/tmp//ccjyalLq.o
ld: fatal: Symbol referencing errors. No output written to hi
collect2: ld returned 1 exit status

Many thanks in advance for your help.

Regards

Rita
 
What platform are you compiling this from?

If you are compiling under Solaris, you would need to add either of the following during linking:

[tt]-lxnet -lnsl -lsocket[/tt]

Hope this helps! [thumbsup]

Rome did not create a great empire by having meetings, they did it by
killing all those who opposed them.

- janvier -
 
Thanks!! It worked.
If I get a such linking errors in future about something else, where can I read the documentation>
 
You could always check your platform's man pages for this. You just type [tt]man gethostbyname[/tt]. If the [tt]man[/tt] pages are not available you can also google it and typing [tt]man gethostbyname[/tt] also.

Rome did not create a great empire by having meetings, they did it by
killing all those who opposed them.

- janvier -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top