LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-14-2006, 10:39 PM   #1
Deviathan
Member
 
Registered: Dec 2005
Posts: 52

Rep: Reputation: 18
Please someone shed light on undefined symbol errors


This generally comes from my lack of knowledge on how linux runs apps, but what the hell is an undefined symbol error? It apparently names the offending library and then I do strings and grep for the symbol and sure enough it's there. Ok, then what the hell is complaining about the symbol error? If it doesn't understand where the symbol is coming from, why not freakin ignore it? Why bitch and then quit out? It's almost like it sees something it doesnt recognize and then says, oh shit, i dont know what that is, let's quit fellas. If it isn't gonna need the symbol then ignore it at least. My specific example is on FC5, where I did a "yum install amarok" which installed without a hitch along with several dependency packages. Good, I thought, saves me from havin to deal with it. Then running amarok generates:

amarokapp: symbol lookup error: /usr/lib/libamarok.so.0: undefined symbol: _ZN9KLineEdit13focusOutEventEP11QFocusEvent

?? WTF? I've seen these kinds of errors pop up before and I haven't the faintest clue why an app cares about a symbol it most likely isn't going to use. My solution for these errors was to not use the version of app or in my particular case for clusters, to NOT use latest and greatest RHEL3 patches. Anyways, I hope someone can enlighten me on this.
 
Old 11-15-2006, 03:45 AM   #2
Dr_P_Ross
Member
 
Registered: Nov 2003
Location: Edinburgh, UK
Distribution: Arch
Posts: 43

Rep: Reputation: 18
An "undefined symbol error" means that when Linux tried to load the chunks of software needed, it couldn't find all the expected ingredients. Usually, a program is not 100% self-contained; instead, it makes use of shared libraries. By this means, commonly used code does not have to be duplicated inside every program that wants to make use of it. But if you don't have some needed library installed, Linux will object in the way you've seen. It can't "freakin ignore it", just as you couldn't ignore it if one of the wheels of your car was missing. The complaint happens when something found to be necessary if the program is to continue, is in fact missing. The software author can choose between different behaviours: complain if something that *might* be needed is missing, or complain if something that *is* needed is missing, and presumably had some good reasons for the choice made.


A symbol doesn't necessarily mean a variable, it also (and usually) means a function. That
bizarre-seeming symbol is a reference to a function in an object-oriented language. In such languages there may be many different functions that, in different contexts, have the same name, so the compiler makes each name unique by `mangling' the name -- have a look at the Wikipedia entry on `name mangling' for further details.

So if you're missing some sort of library, how do you find out which one, you may ask? Try using ldd, eg try the command "ldd /bin/ls" to see what the ls command makes use of.

You can also try googling for the symbol! Often, this gets you quickly to information about what it is you're really missing.
 
Old 11-15-2006, 02:49 PM   #3
Deviathan
Member
 
Registered: Dec 2005
Posts: 52

Original Poster
Rep: Reputation: 18
Ok, I guess I didnt quite explain that one well enough (thanks beer!). To clarify, I was under the impression that the main program was loading the library (i.e. libamarok.so.0) and encountering the symbol and then exiting because it saw something it didn't recognize. I was mistakenly thinking that the symbol was a function defined and implemented in that library and that for some reason the main program saw it and errored because it didnt make a call to it. After posting, I realized that it was a call to a function defined in another library that's missing. This little bit of understanding will go a long way in helping me troubleshoot issues like this in the future.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can anyone shed any light on this audacity error message? user1442 Slackware 11 12-09-2005 08:32 AM
Upgraded FC3 to GTK2.6 - undefined symbol errors, several apps dead rylan76 Linux - Software 1 07-03-2005 10:14 AM
undefined symbol errors ??? gkiagia Linux - Software 0 06-22-2005 02:00 PM
Shed some light on this situaion please? Flak Pyro Fedora 5 05-20-2004 09:40 PM
X errors: libfontconfig.so.1 undefined symbol: FT_Get_PS_Font_Info Don_Quixote Slackware 0 04-25-2004 03:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration