[vtkusers] Library not loaded: libvtkCommon.5.8.dylib

Yifei Li yifli82 at gmail.com
Fri Sep 16 15:18:05 EDT 2011


Well, I can do that.

But I think it's better to change the shared library's install name.
(DYLAD_LIBRARY_PATH is not recommended due to security risk)

Yifei

On Fri, Sep 16, 2011 at 3:07 PM, Roger Bramon Feixas
<rogerbramon at gmail.com>wrote:

> Hi,
>
> I think you have to add the path of your vtk lib directory (default: /usr/local/lib/vtk-5.8)
> to DYLD_LIBRARY_PATH environment variable.
>
> Roger
>
> On Fri, Sep 16, 2011 at 9:04 PM, Yifei Li <yifli82 at gmail.com> wrote:
>
>> Well, I found out the reason for the error, but I'm not sure what's the
>> best way to solve it.
>>
>> The problem resides in the install name of all VTK shared libraries. For
>> example, libVtkCommon.5.8.dylib has an install name of
>> 'libVtkCommon.5.8.dylib' instead of
>> '/usr/local/lib/vtk-5.8/libVtkCommon.5.8.dylib'.
>>
>> Is there any setting in CMake that I can change to fix the problem?
>>
>> Yifei
>>
>>
>> On Fri, Sep 16, 2011 at 2:43 PM, Yifei Li <yifli82 at gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> I got the following runtime error (no building errors):
>>>
>>> *dyld: Library not loaded: libvtkCommon.5.8.dylib*
>>>
>>> *  Referenced from:
>>> /Users/yifli/Documents/Projects/InteractiveSegmentation/build/Debug/InteractiveSegmentation
>>> *
>>> *  Reason: image not found*
>>>
>>> However, I checked that libvtkCommon.5.8.dylib does exist:
>>> -rwxr-xr-x   1 root  wheel  3327352 Sep 14 21:56 libvtkCommon.5.8.0.dylib
>>> lrwxr-xr-x   1 root  wheel       24 Sep 14 21:27 libvtkCommon.5.8.dylib
>>> -> libvtkCommon.5.8.0.dylib
>>> lrwxr-xr-x   1 root  wheel       22 Sep 14 21:27 libvtkCommon.dylib ->
>>> libvtkCommon.5.8.dylib
>>>
>>> The application I'm trying to run is a QMainWindow that has a QVTKWidget
>>> in it.  The CMakeLists.txt I use is:
>>>
>>> cmake_minimum_required(VERSION 2.8)
>>>
>>> project(Simple)
>>>
>>> find_package(VTK)
>>> include(${VTK_USE_FILE})
>>>
>>> find_package(Qt4)
>>> include(${QT_USE_FILE})
>>>
>>> include_directories(${CMAKE_CURRENT_BINARY_DIR})
>>>
>>> set(headers MainWindow.h)
>>> set(srcs main.cpp MainWindow.cpp)
>>> set(uis mainwindow.ui)
>>>
>>> qt4_wrap_ui(ui_srcs ${uis})
>>> qt4_wrap_cpp(moc_headers ${headers})
>>>
>>> add_executable(Simple ${srcs} ${ui_srcs} ${moc_headers} ${headers})
>>> target_link_libraries(Simple
>>>                 ${QT_LIBRARIES}
>>>                 ${VTK_LIBRARIES}
>>>                 QVTK
>>> )
>>>
>>> Yifei
>>>
>>
>>
>> _______________________________________________
>> 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/20110916/f70aafb0/attachment.htm>


More information about the vtkusers mailing list