[vtkusers] undefined reference
Burlen Loring
burlen.loring at kitware.com
Thu Oct 16 19:08:52 EDT 2008
Yenan,
I am seeing the same undefined symbols in both cvs and in a 5.0.4
build, but I am able to load the library without issue.
tycho:~/ext2/del/VTK/VTK$nm -C
/home/burlen/ext2/del/VTK/lib/libvtkCommonPythonD.so | grep
'vtkDirectory::FileIsDirectory'
U vtkDirectory::FileIsDirectory(char const*)
but, vtklibCommonPythonD shows that it will load from libvtkCommon
tycho:~/ext2/del/VTK/VTK$ldd
/home/burlen/ext2/del/VTK/lib/libvtkCommonPythonD.so
linux-gate.so.1 => (0xb7ef2000)
libvtkCommon.so.5.0 =>
/home/burlen/ext2/del/VTK/lib/libvtkCommon.so.5.0 (0xb7b6c000)
libvtksys.so.5.0 =>
/home/burlen/ext2/del/VTK/lib/libvtksys.so.5.0 (0xb7b30000)
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7b03000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7aff000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7a0c000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb79e7000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb79dc000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb788d000)
/lib/ld-linux.so.2 (0xb7ef3000)
I don't know why the symbols would be undefined if ldd shows that it can
find libvtkCommon.
I tested that I could load the the library and had no problems:
//g++ -L /home/burlen/ext2/del/VTK/lib -lpython2.5 ./TestCommonPyD.cpp
-o test
#include<iostream>
using namespace std;
#include "dlfcn.h"
int main()
{
void *ok=dlopen("libvtkCommonPythonD.so.5.0.4",RTLD_NOW);
if (!ok)
{
cerr << dlerror() << endl;
}
else
{
cerr << "Ok" << endl;
}
return 0;
}
Burlen
Yenan Qu wrote:
> Here is the Output:
> libvtkCommon.so.5.0 => /usr/lib64/libvtkCommon.so.5.0 (0x00002aaaaad7b000)
> libvtksys.so.5.0 => /usr/lib64/libvtksys.so.5.0 (0x00002aaaab019000)
> libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aaaab13c000)
> libdl.so.2 => /lib64/libdl.so.2 (0x00002aaaab255000)
> libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002aaaab359000)
> libm.so.6 => /lib64/libm.so.6 (0x00002aaaab558000)
> libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002aaaab6da000)
> libc.so.6 => /lib64/libc.so.6 (0x00002aaaab7e7000)
> /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
> undefined symbol: PyExc_RuntimeError (./libvtkCommonPythonD.so)
> undefined symbol: _Py_NoneStruct (./libvtkCommonPythonD.so)
> undefined symbol: PyString_Type (./libvtkCommonPythonD.so)
> undefined symbol: PyExc_KeyboardInterrupt (./libvtkCommonPythonD.so)
> undefined symbol: PyLong_Type (./libvtkCommonPythonD.so)
> undefined symbol: PyExc_ValueError (./libvtkCommonPythonD.so)
> undefined symbol: PyExc_TypeError (./libvtkCommonPythonD.so)
> undefined symbol: PyTuple_Type (./libvtkCommonPythonD.so)
> undefined symbol: PyExc_AttributeError (./libvtkCommonPythonD.so)
> undefined symbol: PyCFunction_Type (./libvtkCommonPythonD.so)
> undefined symbol: PyDict_Type (./libvtkCommonPythonD.so)
> undefined symbol: PyType_Type (./libvtkCommonPythonD.so)
> undefined symbol: PyInt_FromLong (./libvtkCommonPythonD.so)
> undefined symbol: PyEval_GetGlobals (./libvtkCommonPythonD.so)
> undefined symbol: PyDict_DelItemString (./libvtkCommonPythonD.so)
> undefined symbol: PyObject_Free (./libvtkCommonPythonD.so)
> undefined symbol: PySequence_GetItem (./libvtkCommonPythonD.so)
> undefined symbol: Py_AtExit (./libvtkCommonPythonD.so)
> undefined symbol: PyErr_ExceptionMatches (./libvtkCommonPythonD.so)
> undefined symbol: _ZN12vtkDirectory15FileIsDirectoryEPKc (./libvtkCommonPythonD.so)
> undefined symbol: PyDict_SetItemString (./libvtkCommonPythonD.so)
> undefined symbol: _ZN9vtkObject18RemoveAllObserversEv (./libvtkCommonPythonD.so)
> undefined symbol: Py_BuildValue (./libvtkCommonPythonD.so)
> undefined symbol: PyObject_ClearWeakRefs (./libvtkCommonPythonD.so)
> undefined symbol: PyErr_SetString (./libvtkCommonPythonD.so)
> undefined symbol: PyDict_SetItem (./libvtkCommonPythonD.so)
> undefined symbol: PyLong_FromLong (./libvtkCommonPythonD.so)
> undefined symbol: PySequence_SetItem (./libvtkCommonPythonD.so)
> undefined symbol: Py_InitModule4 (./libvtkCommonPythonD.so)
> undefined symbol: _PyObject_New (./libvtkCommonPythonD.so)
> undefined symbol: PyArg_ParseTupleAndKeywords (./libvtkCommonPythonD.so)
> undefined symbol: PyGILState_Ensure (./libvtkCommonPythonD.so)
> undefined symbol: _PyString_Resize (./libvtkCommonPythonD.so)
> undefined symbol: PyObject_GetAttrString (./libvtkCommonPythonD.so)
> undefined symbol: PyString_FromStringAndSize (./libvtkCommonPythonD.so)
> undefined symbol: PyGILState_Release (./libvtkCommonPythonD.so)
> undefined symbol: PyCallable_Check (./libvtkCommonPythonD.so)
> undefined symbol: PyList_SetItem (./libvtkCommonPythonD.so)
> undefined symbol: PyDict_DelItem (./libvtkCommonPythonD.so)
> undefined symbol: PyTuple_GetItem (./libvtkCommonPythonD.so)
> undefined symbol: _ZN12vtkDirectory16GetNumberOfFilesEv (./libvtkCommonPythonD.so)
> undefined symbol: PyDict_New (./libvtkCommonPythonD.so)
> undefined symbol: PyList_Sort (./libvtkCommonPythonD.so)
> undefined symbol: PyErr_Clear (./libvtkCommonPythonD.so)
> undefined symbol: PyString_AsString (./libvtkCommonPythonD.so)
> undefined symbol: PyString_FromString (./libvtkCommonPythonD.so)
> undefined symbol: PyList_New (./libvtkCommonPythonD.so)
> undefined symbol: PyFloat_AsDouble (./libvtkCommonPythonD.so)
> undefined symbol: PyDict_GetItem (./libvtkCommonPythonD.so)
> undefined symbol: PyModule_GetDict (./libvtkCommonPythonD.so)
> undefined symbol: PyString_InternFromString (./libvtkCommonPythonD.so)
> undefined symbol: PyTuple_Size (./libvtkCommonPythonD.so)
> undefined symbol: Py_FatalError (./libvtkCommonPythonD.so)
> undefined symbol: PyType_IsSubtype (./libvtkCommonPythonD.so)
> undefined symbol: PyLong_FromUnsignedLong (./libvtkCommonPythonD.so)
> undefined symbol: PyEval_CallObjectWithKeywords (./libvtkCommonPythonD.so)
> undefined symbol: PyLong_AsLongLong (./libvtkCommonPythonD.so)
> undefined symbol: PyInt_AsLong (./libvtkCommonPythonD.so)
> undefined symbol: PyErr_Print (./libvtkCommonPythonD.so)
> undefined symbol: PyArg_VaParse (./libvtkCommonPythonD.so)
> undefined symbol: PyCFunction_NewEx (./libvtkCommonPythonD.so)
> undefined symbol: PyDict_GetItemString (./libvtkCommonPythonD.so)
> undefined symbol: PyTuple_GetSlice (./libvtkCommonPythonD.so)
> undefined symbol: Py_Exit (./libvtkCommonPythonD.so)
> undefined symbol: PyFloat_FromDouble (./libvtkCommonPythonD.so)
> undefined symbol: PyArg_ParseTuple (./libvtkCommonPythonD.so)
> undefined symbol: PyMethod_New (./libvtkCommonPythonD.so)
> undefined symbol: PyTuple_New (./libvtkCommonPythonD.so
>
> ----- Original Message -----
> From: Burlen Loring <burlen.loring at kitware.com>
> Date: Thursday, October 16, 2008 11:48 am
> Subject: Re: [vtkusers] undefined reference
> To: Yenan Qu <yq07 at fsu.edu>
> Cc: vtkusers at vtk.org
>
>
>> Its clearly a linking issue, what is the output of the command:
>>
>> ldd -r /path/to/your/vtk/libs/libvtkCommonPythonD.so
>>
>>
>>
>> Yenan Qu wrote:
>>
>>> Nobody really had the same problem?
>>>
>>> ----- Original Message -----
>>> From: Yenan Qu <yq07 at fsu.edu>
>>> Date: Wednesday, October 15, 2008 12:03 pm
>>> Subject: [vtkusers] undefined reference
>>> To: vtkusers at vtk.org
>>>
>>>
>>>
>>>> Hi, all,
>>>>
>>>> I have built the vtk5.0.4 without problem. But, when I compile
>>>>
>> my
>>
>>>> code with the new VTK, I got the error below"
>>>>
>>>> /home/yenanqu/VTK-BUILD/lib/libvtkCommonPythonD.so: undefined
>>>> reference to `vtkDirectory::FileIsDirectory(char const*)'
>>>> /home/yenanqu/VTK-BUILD/lib/libvtkCommonPythonD.so: undefined
>>>> reference to `vtkObject::RemoveAllObservers()'
>>>>
>>>> I have check vtk source code for both .h and . cxx, the methods
>>>> vtkDirectory::FileIsDirectory and tkObject::RemoveAllObservers()
>>>> are well delcared and difined there without differences from
>>>> others. Does any one know why it wasn't just builded in to the
>>>>
>> lib?>> Thank you in advance.
>>
>>>> Yenan
>>>>
>>>> _______________________________________________
>>>> This is the private VTK discussion list.
>>>> Please keep messages on-topic. Check the FAQ at:
>>>> http://www.vtk.org/Wiki/VTK_FAQFollow this link to
>>>> subscribe/unsubscribe:http://www.vtk.org/mailman/listinfo/vtkusers
>>>>
>>>>
>>>>
>>> _______________________________________________
>>> This is the private VTK discussion list.
>>> Please keep messages on-topic. Check the FAQ at:
>>>
>> http://www.vtk.org/Wiki/VTK_FAQ> Follow this link to
>> subscribe/unsubscribe:> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>>
>>>
>> --
>> Burlen Loring
>> Kitware, Inc.
>> R&D Engineer
>> 28 Corporate Drive
>> Clifton Park, NY 12065-8662
>> Phone: 518-371-3971 x137
>>
>>
>>
--
Burlen Loring
Kitware, Inc.
R&D Engineer
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x137
More information about the vtkusers
mailing list