[vtkusers] QVTKWidget linux link error "relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; "

Ashika Umanga Umagiliya aumanga at biggjapan.com
Thu Sep 9 01:00:12 EDT 2010


Hello again,

I added the code-snippet to the root CMake file of VTK and rebuild VTK.
Now I can build my library without errors.
Are there any issues with this approach ?

thanks
umanga

On 9 September 2010 13:35, Ashika Umanga Umagiliya
<aumanga at biggjapan.com> wrote:
> Hi again Karthik,
>
> I compiled my library by adding your code-snippet but still gave the same error.
> So,I modified "VTK/GUISupport/CMakeLists.txt" file accordingly and now
> it gives the following error complaning about   "libvtkRendering.a":
>
> "umanga at akaishi:/work/svn-checkout/osaka3d/osaka3d/trunk/osaka3d/rinzo-platform/src/dlplugins/vtkviewer$
> make
> Linking CXX shared library
> /work/svn-checkout/osaka3d/osaka3d/trunk/osaka3d/rinzo-platform/dist/plugins/libRzDLVTKView.so
> /usr/bin/ld: /usr/local/lib/vtk-5.6/libvtkRendering.a(vtkActor.cxx.o):
> relocation R_X86_64_32 against `a local symbol' can not be used when
> making a shared object; recompile with -fPIC
> /usr/local/lib/vtk-5.6/libvtkRendering.a: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> make[2]: *** [/work/svn-checkout/osaka3d/osaka3d/trunk/osaka3d/rinzo-platform/dist/plugins/libRzDLVTKView.so]
> Error 1
> make[1]: *** [CMakeFiles/RzDLVTKView.dir/all] Error 2
> make: *** [all] Error 2"
>
> Do I have to modify the root CMake file of VTK ?
>
> regards,
> umanga
>
>
>
> On 6 September 2010 13:59, Karthik Krishnan
> <karthik.krishnan at kitware.com> wrote:
>> Add something along the following lines to your CMakeLists.txt just before
>> the compiling the RzDLVTKView library below :
>>
>>
>> if(UNIX AND NOT WIN32)
>>   find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
>>   if(CMAKE_UNAME)
>>     exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR)
>>     set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR} CACHE INTERNAL
>> "processor type (i386 and x86_64)")
>>     if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
>>       add_definitions(-fPIC)
>>     endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
>>   endif(CMAKE_UNAME)
>> endif(UNIX AND NOT WIN32)
>>
>>
>>
>>
>>
>> On Mon, Sep 6, 2010 at 7:08 AM, Ashika Umanga Umagiliya
>> <aumanga at biggjapan.com> wrote:
>>>
>>> Greetings all,
>>>
>>> I compiled VTK 5.6 with QT support in Debian 64bit.
>>> But when I build my project ,during linking, I get the following error.
>>>
>>> [ 98%] Building CXX object
>>> src/dlplugins/vtkviewer/CMakeFiles/RzDLVTKView.dir/moc_RzPluginVTKViewerFactory.cxx.o
>>> Linking CXX shared library ../../../dist/plugins/libRzDLVTKView.so
>>> /usr/bin/ld: /usr/local/lib/vtk-5.6/libQVTK.a(QVTKWidget.cxx.o):
>>> relocation R_X86_64_32S against `a local symbol' can not be used when making
>>> a shared object; recompile with -fPIC
>>> /usr/local/lib/vtk-5.6/libQVTK.a: could not read symbols: Bad value
>>> collect2: ld returned 1 exit status
>>>
>>> Any tips ?
>>> thanks in advance,
>>> umanga
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>
>>
>



More information about the vtkusers mailing list