Re: Failed to load Dynamic link library (undefined symbol)

From: Vassili Maroussov <Vassili.Maroussov_at_cern.ch>
Date: Tue, 27 Sep 2011 16:51:24 +0200


Sorry,

it was caused by a destructor with no body :)

On 09/27/2011 04:38 PM, Vassili Maroussov wrote:
> Dear ROOTers,
>
> I'm getting the "Failed to load Dynamic link library (undefined
> symbol)" error for a compiled library which contains seems to be the
> simplest object inherited from TObject (I've started with a usable
> object :) ). Probably there is a stupid error in the code, but I
> couldn't find it. Could you help me, please? Files are in the
> attachment and ROOT session transcript is below.
>
> Regards,
>
> Vassili
>
> ----------- The ROOT session transcript -----------
>
> [vmarouss_at_Ezhik-HDX18 Test2]$
> [vmarouss_at_Ezhik-HDX18 Test2]$ uname -a
> Linux Ezhik-HDX18 2.6.35.14-96.fc14.x86_64 #1 SMP Thu Sep 1 11:59:56
> UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
> [vmarouss_at_Ezhik-HDX18 Test2]$
> [vmarouss_at_Ezhik-HDX18 Test2]$ ls -l
> total 16
> -rw-r--r--. 1 vmarouss kr 1325 Sep 27 16:15 Makefile
> -rw-r--r--. 1 vmarouss kr 79 Sep 27 15:56 MyObj.cpp
> -rw-r--r--. 1 vmarouss kr 545 Sep 27 16:07 MyObj.h
> -rw-r--r--. 1 vmarouss kr 150 Sep 27 15:56 MyObjLinkDef.h
> [vmarouss_at_Ezhik-HDX18 Test2]$
> [vmarouss_at_Ezhik-HDX18 Test2]$ make
> g++ -O2 -Wall -fPIC -pthread -m64 -I/usr/local/ROOT/pro/include -c
> MyObj.cpp
> Generating dictionary MyObjDict.cpp...
> MyObjDict.cpp done
> g++ -O2 -Wall -fPIC -pthread -m64 -I/usr/local/ROOT/pro/include -c
> MyObjDict.cpp
> g++ -shared -O2 -Wall -fPIC -pthread -m64
> -I/usr/local/ROOT/pro/include MyObj.o MyObjDict.o
> -L/usr/local/ROOT/pro/lib -lCore -lCint -lRIO -lNet -lHist -lGraf
> -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics
> -lMathCore -lThread -pthread -lm -ldl -rdynamic -o libMyObj.so
> libMyObj.so done
> [vmarouss_at_Ezhik-HDX18 Test2]$
> [vmarouss_at_Ezhik-HDX18 Test2]$ ls -l
> total 132
> -rwxr-xr-x. 1 vmarouss kr 39260 Sep 27 16:20 libMyObj.so
> -rw-r--r--. 1 vmarouss kr 1325 Sep 27 16:15 Makefile
> -rw-r--r--. 1 vmarouss kr 79 Sep 27 15:56 MyObj.cpp
> -rw-r--r--. 1 vmarouss kr 25064 Sep 27 16:20 MyObjDict.cpp
> -rw-r--r--. 1 vmarouss kr 1987 Sep 27 16:20 MyObjDict.h
> -rw-r--r--. 1 vmarouss kr 37344 Sep 27 16:20 MyObjDict.o
> -rw-r--r--. 1 vmarouss kr 545 Sep 27 16:07 MyObj.h
> -rw-r--r--. 1 vmarouss kr 150 Sep 27 15:56 MyObjLinkDef.h
> -rw-r--r--. 1 vmarouss kr 2272 Sep 27 16:20 MyObj.o
> [vmarouss_at_Ezhik-HDX18 Test2]$
> [vmarouss_at_Ezhik-HDX18 Test2]$ env | grep LD
> OLDPWD=/home/vmarouss/ROOTFLUKA64
> LD_LIBRARY_PATH=/usr/local/ROOT/pro/lib:/usr/lib64/alliance/lib:.
> [vmarouss_at_Ezhik-HDX18 Test2]$
> [vmarouss_at_Ezhik-HDX18 Test2]$ root
> *******************************************
> * *
> * W E L C O M E to R O O T *
> * *
> * Version 5.28/00b 14 March 2011 *
> * *
> * You are welcome to visit our Web site *
> * http://root.cern.ch *
> * *
> *******************************************
>
> ROOT 5.28/00b (branches/v5-28-00-patches_at_38394, Apr 14 2011, 17:55:00
> on linuxx8664gcc)
>
> CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
> Type ? for help. Commands must be C++ statements.
> Enclose multiple statements between { }.
> root [0] gSystem->Load("libMyObj")
> dlopen error: /home/vmarouss/ROOTFLUKA64/Test2/./libMyObj.so:
> undefined symbol: _ZTV5MyObj
> Load Error: Failed to load Dynamic link library
> /home/vmarouss/ROOTFLUKA64/Test2/./libMyObj.so
> (int)(-1)
> root [1] .q
> [vmarouss_at_Ezhik-HDX18 Test2]$
>
>
Received on Tue Sep 27 2011 - 16:51:31 CEST

This archive was generated by hypermail 2.2.0 : Tue Sep 27 2011 - 23:50:02 CEST