LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-24-2012, 10:17 PM   #16
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled

Quote:
Originally Posted by R00ts View Post
First thing I did was run ldd on the library that has the undefined symbols.

Code:
$ ldd lib/tcs/drivers/i400/TCStcl.so 
    linux-vdso.so.1 =>  (0x00007fff4bab8000)
    libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f3d751a3000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f3d74f1f000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f3d74d09000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f3d74953000)
    /lib64/ld-linux-x86-64.so.2 (0x000000392fc00000)
I ran ldd on the same library on the build machine, and received similar results. Next I used nm to find the symbol list in the file name, and sure enough the _ZTV4Line symbol was undefined (along with many other undefined symbols).

Code:
$ nm lib/tcs/drivers/i400/TCStcl.so 
.....
                 U _ZTV12Serializable
                 U _ZTV24TAO_Abstract_ServantBase
                 U _ZTV4Line
                 U _ZTV5Point
                 U _ZTVN10__cxxabiv117__class_type_infoE@@CXXABI_1.3
.....
First of all, undefined symbols in the symbol table of a shared library mean one of three things:
  1. The program (or library) linking to the shared library in question defines those symbols.
  2. A library the shared library in question is linked to defines those symbols.
  3. Those symbols remain undefined when the dynamic linker strings everything together, giving you an error.
"Undefined" is only bad in the third case, which often happens if you take a library or program compiled on one machine and try to run it on another because the symbols exported by the libraries on the new machine might differ. The benefit of dynamic linking is that these symbols are resolved once during linking for verification, but then they're resolved again at run-time. This allows you to rebuild a library (e.g. upgrade it) without having to rebuild all of the things that depend on it.
Kevin Barry

Last edited by ta0kira; 01-24-2012 at 10:20 PM. Reason: corrected wording
 
Old 01-25-2012, 12:57 PM   #17
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Original Poster
Rep: Reputation: 30
Yeah, I've been reading a helpful document on shared libraries to fill my knowledge gaps (http://www.akkadia.org/drepper/dsohowto.pdf).


I think I made a major breakthrough this morning. What I did was to remove the line in the Tcl script that loads the Commontcl.so library where all these missing symbols are located. I replaced that by going into the C++ code and calling dlopen instead:

Code:
  void* retval = dlopen("lib/common/drivers/Commontcl.so", RTLD_NOW | RTLD_GLOBAL);
  if (retval == NULL) {
    std::cerr << "Failed to open Commontcl.so. dlerror: " << std::endl;
    std::cerr << dlerror() << std::endl;
  }
Lo and behold, now there are no unresolved symbols! So naturally my guess is that somehow the default settings for how Tcl loads shared library files changed. So I'm looking into that at the moment.
 
Old 01-26-2012, 01:03 PM   #18
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Original Poster
Rep: Reputation: 30
Well I fixed the problem (in an acceptable manner). I uninstalled Tcl that came on my Fedora 16 system (1.8.5.11) and installed Tcl 8.6b1 from source and then I had no problems with undefined symbols. So it may just be that that particular Tcl version/package is buggy. Well that only took me two weeks to find out.


Thanks for your help here everyone.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Su to root works fine @ console, fails in x (cant login at all when using xdm) lionsong Slackware 5 09-06-2009 07:22 PM
DHCP via router on Debian fails, XP works fine oopsdude Linux - Wireless Networking 8 09-02-2008 08:51 PM
Vista fails to print when going to CUPS. XP works fine. yah0m Linux - Software 1 08-09-2008 09:54 AM
rdc:/ KDE ioslave fails, rdesktop works fine utahnix SUSE / openSUSE 0 02-04-2008 09:51 PM
Xorgcfg - undefined symbols and fails to load modules Perps *BSD 0 07-07-2007 09:49 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:50 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration