[vtkusers] Library not loaded: libvtkCommon.5.8.dylib
Yifei Li
yifli82 at gmail.com
Fri Sep 16 15:04:13 EDT 2011
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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110916/014e6692/attachment.htm>
More information about the vtkusers
mailing list