[vtkusers] X11 CMake Errors on Mac

David Gobbi david.gobbi at gmail.com
Fri Jan 4 18:10:18 EST 2013


I can expand on this a bit, and give my own perspective. A bundled app on
OS X can find run-time libraries in three ways:

1) it can find them in the system paths, e.g. in /usr/lib or in
/System/Library/Frameworks

2) it can find them within the bundle itself, i.e. within
MyApplication.app/Contents/MacOS or in
MyApplication.app/Contents/Frameworks/

3) it can find them in the DYLD_LIBRARY_PATH

When I'm ready to deploy my app I do a "make install" that copies all the
Qt and VTK libraries into my bundle.  CMake can automatically figure out
the dependencies and modify the libraries and the executable so that they
can find each other within the bundle, which makes it unnecessary to use
DYLD_LIBRARY_PATH with a bundle created via "make install".

But like Mike suggested, I stick to using DYLD_LIBRARY_PATH and running my
programs from the terminal until I'm ready to deploy them.  It's only when
I'm ready to deploy that I do a "make install" to create a stand-alone
bundle.

 - David


On Fri, Jan 4, 2013 at 3:28 PM, Michael Jackson <mike.jackson at bluequartz.net>
wrote:
> Set the DYLD_LIBRARY_PATH to include the directory where the vtk
libraries are located. From a bash shell it is something like this:
>
> export DYLD_LIBRARY_PATH=/Path/To/Your/Built/VTK
>
> Then try to run the executable from that same terminal.
> --
> Mike Jackson <www.bluequartz.net>
>
> On Jan 4, 2013, at 5:25 PM, Berkowitz, Benjamin M wrote:
>
>> I'm not sure if this is relevant, but I got this error when running the
executable in the terminal:
>>
>> dyld: Library not loaded: libQVTK.5.10.dylib
>>  Referenced from:
/Users/benberkowitz/Desktop/EventQtSlotConnect/build/EventQtSlotConnect.app/Contents/MacOS/EventQtSlotConnect
>>  Reason: image not found
>> Trace/BPT trap: 5
>>
>>
>> Ben
>>
>>
>> On Jan 4, 2013, at 4:16 PM, Bill Lorensen <bill.lorensen at gmail.com>
>> wrote:
>>
>>> Ben and David,
>>>
>>> I have fixed the wiki template for the vtk/qt cmakelists.txt file. The
>>> tarbars should be updated tonight.
>>>
>>> Thanks for the feedback and help,
>>>
>>> Bill
>>>
>>> On Fri, Jan 4, 2013 at 4:59 PM, Bill Lorensen <bill.lorensen at gmail.com>
wrote:
>>>> David,
>>>>
>>>> Looks like VTK5.10 does not include QVTK in its list of libraries.
>>>>
>>>> I will have to work out a solution that works for both VTK5 and VTK6.
>>>>
>>>> Ben,
>>>>
>>>> for the time being add QVTK to ythe list of target_link_libraries.
>>>>
>>>> Bill
>>>>
>>>> On Fri, Jan 4, 2013 at 4:51 PM, Bill Lorensen <bill.lorensen at gmail.com>
wrote:
>>>>> Hmmm. VTK_LIBRARIES should include that.
>>>>>
>>>>> I'll verify on my linux build with VTK5. It's very easy to fix all the
>>>>> qt examples on the wiki since they use a wiki template.
>>>>>
>>>>> Thanks David.
>>>>>
>>>>> Bill
>>>>>
>>>>>
>>>>> On Fri, Jan 4, 2013 at 4:31 PM, David Gobbi <david.gobbi at gmail.com>
wrote:
>>>>>> I just tried building that example against my own VTK 5.10.1,
>>>>>> which is built with VTK_USE_QT, and Qt4.8.3.  I saw exactly
>>>>>> the same error that Ben reported:
>>>>>>
>>>>>> Undefined symbols:
>>>>>> "QVTKWidget::QVTKWidget(QWidget*, QFlags<Qt::WindowType>)"
>>>>>>
>>>>>> When built against VTK 5.10 (or VTK 5.10.1), this example is not
>>>>>> linking to the QVTK library.  Its CMakeLists.txt has to be fixed.
>>>>>>
>>>>>> - David
>>>>>>
>>>>>>
>>>>>> On Fri, Jan 4, 2013 at 2:21 PM, Bill Lorensen <
bill.lorensen at gmail.com> wrote:
>>>>>>> I'm builid a VTK5 QT 4.7.4 on linux right now. Later I'll try my
Mac,
>>>>>>> but I don't think I use Qt 4.8.
>>>>>>>
>>>>>>> David may be correct that the CMakeLists.txt file is broken.
>>>>>>> Unfortunately, we can only test so many combinations of VTK/Qt
>>>>>>> versions.
>>>>>>>
>>>>>>> Bill
>>>>>>>
>>>>>>> On Fri, Jan 4, 2013 at 4:19 PM, Berkowitz, Benjamin M
>>>>>>> <benjamin-berkowitz at uiowa.edu> wrote:
>>>>>>>> VTK 5.10.1 and Qt 4.8.4
>>>>>>>>
>>>>>>>> The options that I changed from default were:
>>>>>>>> VTK_USE_QT = ON
>>>>>>>> VTK_USE_GUISUPPORT = ON
>>>>>>>> BUILD_SHARED_LIBS = ON
>>>>>>>>
>>>>>>>> and as a side note, I've tried using CMAKE_BUILD_TYPE as both
Debug and Release mode with the same result.  For now I left it as the
default Debug.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Jan 4, 2013, at 3:11 PM, Bill Lorensen <bill.lorensen at gmail.com>
wrote:
>>>>>>>>
>>>>>>>>> And VTK 5.10?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Fri, Jan 4, 2013 at 4:09 PM, Berkowitz, Benjamin M
>>>>>>>>> <benjamin-berkowitz at uiowa.edu> wrote:
>>>>>>>>>> Yes
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Jan 4, 2013, at 3:02 PM, Bill Lorensen <
bill.lorensen at gmail.com>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> Is your VTK built with QT turned on?
>>>>>>>>>>>
>>>>>>>>>>> On Fri, Jan 4, 2013 at 3:57 PM, Berkowitz, Benjamin M
>>>>>>>>>>> <benjamin-berkowitz at uiowa.edu> wrote:
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Unpaid intern in BillsBasement at noware dot com
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Unpaid intern in BillsBasement at noware dot com
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Unpaid intern in BillsBasement at noware dot com
>>>>
>>>>
>>>>
>>>> --
>>>> Unpaid intern in BillsBasement at noware dot com
>>>
>>>
>>>
>>> --
>>> Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130104/8027525d/attachment.htm>


More information about the vtkusers mailing list