On 09/09/2007, at 11:11 AM, Ronald Oussoren wrote:

On 7 Sep, 2007, at 17:25, Drew McCormack wrote:

I'm a PyObjC newbie, so please excuse me if this is a simple/dumb question:

I want to build a PyObjC app that uses VTK. I have a Cocoa build of VTK. In the main function that starts the python interpreter, I added setenv calls for PYTHONPATH and DYLD_LIBRARY_PATH so that the VTK dylibs and shared object files would be found. When I run the app from Xcode, I get an exception because  it can't find a dylib:

dyld: Library not loaded: libvtkCommon.5.0.dylib
  Referenced from: /Users/cormack/Develop/Build/Debug/PyAnimoltion.app/Contents/MacOS/PyAnimoltion
  Reason: image not found

I figured maybe I had to link the VTK dylib into the main executable, so I added them to the project, but I still get errors related to missing dylibs, even though the dylibs are in the DYLD_LIBRARY_PATH set with setenv.

Can anyone advise me how to correctly add dylibs from an external module to a PyObjC app?

Setting DYLD_LIBRARY_PATH mostly likely means that somethings wrong with your environment or installation of VTK (or even VTK in general). Settings DYDL_LIBRARY_PATH should never be necessary on OSX and can cause vague problems all by itself.


Is that because the executable path is stored in the dylibs? 

So how should I go about 'importing' VTK into the pyobjc project? Should I add the VTK dylibs to the pyobjc Xcode project so that they get linked to the app executable? What about the VTK .so files? (I guess they are disguised dylibs) Should I link those into the Xcode executable too?