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

Karthik Krishnan karthik.krishnan at kitware.com
Mon Sep 6 00:59:53 EDT 2010


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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100906/181b1587/attachment.htm>


More information about the vtkusers mailing list