[vtkusers] using Xcode for debugging VTK C++ examples?

mitja_mreza at indiana.edu mitja_mreza at indiana.edu
Wed Oct 12 12:22:51 EDT 2011


Thank you, that was helpful.

I've manually added DYLD_LIBRARY_PATH in Xcode, for the executable I want to try debugging, thus:

1a) in "groups & files" in the main Xcode window, under "Executables", right click the name of the executable (here named "Cone" since it's the Step1 VTK example) and choose Get Info

1b) or directly in menu Project -> Edit Active Executable "Cone"

2) in the Info dialog, under the "Arguments" tab, add to the bottom pane "Variables to be set in the environment":

3) use "+" button, set Name to "DYLD_LIBRARY_PATH", set Value to the full path pointing to the ..../lib/vtk-5.4 directory

It now works fine, even step-by-step debug in Xcode!

Now it'd be useful to figure out if this specific DYLD_LIBRARY_PATH setting can be defined directly in the CMakeCache.txt file that generates the Xcode project, so that it doesn't have to be added manually later every time an xcodeproj is generated.  Since in any case the CMakeCache.txt file has to point to the same VTK directory, for compilation, for the "VTK_DIR" value.
... any idea as to where such settings may be described, e.g. in a manual or tutorial?

Thanks again,
-Mitja



> That is because the generated libraries do not have their path encoded in the libraries so the executables do not know where to find them. Basically you need to set the "DYLD_LIBRARY_PATH" to the "bin" directory inside the binary directory. This is probably done through some property the executable in the Xcode project, or maybe on a global for all executables somewhere in the Xcode project. 
>  Maybe there is an option somewhere in the building of VTK to have those paths set in the generated libraries. Not sure. Probably something about BUILD_DIR or running from BUILD_DIR or something like that. It has been a very long time since I have built VTK, but that _is_ the problem.
> ___________________________________________________________
> Mike Jackson                    Principal Software Engineer
> BlueQuartz Software                            Dayton, Ohio
> mike.jackson at bluequartz.net              www.bluequartz.net




More information about the vtkusers mailing list