The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Symbol referencing error fromatz High Level Programming 1 03-17-2008 06:01 PM
C++ Compiling error.. Symbol Reference bjena UNIX for Advanced & Expert Users 3 08-09-2006 03:10 AM
ld: fatal: Symbol referencing errors. No output written to SNX jerryragland High Level Programming 1 08-09-2006 02:15 AM
symbol referencing error suhasini High Level Programming 1 04-03-2006 07:43 AM
ld: fatal: Symbol referencing errors alfabetman UNIX for Dummies Questions & Answers 2 01-08-2002 04:57 AM

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 07-11-2001
spotanddot spotanddot is offline
Registered User
  
 

Join Date: Jun 2001
Posts: 10
Question Compiling Errors -- Symbol referencing

I'm trying to compile a FTP_API program. To do this you must use the libftp.so libary. But that libary has references which are not defined. Has anyone had this problems and how is it corrected??

The command line looks like this:--------------------------------------------
# cc ftpstock.c -lftp
Undefined.........................first referenced
symbol..............................in file
_xlisten............................./udk/usr/lib/libftp.so
_xbind.............................../udk/usr/lib/libftp.so
_xsetsockopt ..................../udk/usr/lib/libftp.so
_xconnect........................../udk/usr/lib/libftp.so
gethostbyname................./udk/usr/lib/libftp.so
_xaccept............................/udk/usr/lib/libftp.so
getservbyname................../udk/usr/lib/libftp.so
inet_ntoa.........................../udk/usr/lib/libftp.so
_xsocket............................./udk/usr/lib/libftp.so
inet_addr............................/udk/usr/lib/libftp.so
_xgetsockname................../udk/usr/lib/libftp.so
UX:ld: ERROR: a.out: fatal error: Symbol referencing errors. No output written to a.out
-------------------------------------------------------------------------------

Want do you guys think? I have stdio.h and net/libftp.h included in the file.

Thanks,
Mike


Last edited by spotanddot; 07-11-2001 at 10:39 AM..
  #2 (permalink)  
Old 07-11-2001
Neo's Avatar
Neo Neo is online now Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,777
libftp.so needs the socket libaries. There was a thread recently with the same exact problem and the -lsocket or -lsock linker option was described. Sound like you need to link the socket libs.
  #3 (permalink)  
Old 07-11-2001
spotanddot spotanddot is offline
Registered User
  
 

Join Date: Jun 2001
Posts: 10
I've done that and two different functions that have no references which are not defined pop up. It's an endless circle.

__use_iks_version.................../udk/usr/lib/libsocket.so
_set_use_iks_version............../udk/usr/lib/libsocket.so


Tkanks neo,

Mike
  #4 (permalink)  
Old 07-11-2001
Neo's Avatar
Neo Neo is online now Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,777
No, it is not an endless circle, it is a straight line making sure that all the libraries are linked during the linking phase -- pretty much one of the core architecturals constructs of C programming. Finding all the libraries takes time if you have not used them before. After using them; it gets easier

Having said that, I am not sure which libs have the symbols you are missing in the sockets library. What version of UNIX are you working with and what is the compiler?
  #5 (permalink)  
Old 07-11-2001
reddyb reddyb is offline
Registered User
  
 

Join Date: Jun 2001
Location: USA
Posts: 21
Similar case

Did you try with
cc progra.c -lsocket -lnsl

not sure whether this will help you

thanks
Reddyb
  #6 (permalink)  
Old 07-11-2001
spotanddot spotanddot is offline
Registered User
  
 

Join Date: Jun 2001
Posts: 10
Thanks guys,

reddyb--
including -lnsl worked!!!!

Thanks again,
Mike
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 10:04 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