4

I have a problem while running executable on mac OS X(Yosemite 10.10.5 ). I cloned and builded an open cascade library and there is an executable in directory for testing. When I type ./DRAWEXE on command prompt, I got following result.

dyld: Library not loaded: libTKDraw.10.dylib
  Referenced from: /Documents/Practices/openSourceProjects/oce/bin/./DRAWEXE
  Reason: image not found
Trace/BPT trap: 5

How can I fix this problem?

Arslan Ali
  • 17,418
  • 8
  • 58
  • 76
Wilmort
  • 294
  • 2
  • 15
  • What does `otool -L /path/to/DRAWEXE | grep TKDraw` show? – trojanfoe Aug 24 '15 at 07:35
  • libTKDraw.9.dylib (compatibility version 9.0.0, current version 9.0.0) How can I install this library? – Wilmort Aug 24 '15 at 18:04
  • OK, so there is no path (like `/usr/local/lib` for example). The dynamic linker cannot find it. – trojanfoe Aug 24 '15 at 18:10
  • I know the path of libs but I do not know how can I set from command prompt? – Wilmort Aug 24 '15 at 18:24
  • `install_name_tool`. – trojanfoe Aug 24 '15 at 18:24
  • Actually, I tried this: install_name_tool -add_rpath Users/Brky/Documents/Practices/openSourceProjects/oce/lib/libTKDraw.9.0.0.dylib DRAWEXE But DRAWEXE is still not working.. – Wilmort Aug 24 '15 at 19:03
  • `rpath` is a path, not a filename (remove the `.dylib`) and then change the reference from `libTKDraw.9.0.0.dylib` to `@rpath/libTKDraw.9.0.0.dylib`. – trojanfoe Aug 24 '15 at 22:14
  • I tried this: install_name_tool -add_rpath Users/Brky/Documents/Practices/openSourceProjects/oce/lib/oce-0.16 where libTKDraw.9.0.0.dylib and the result is : DRAWEXE (for architecture x86_64) option "-add_rpath Users/Brky/Documents/Practices/openSourceProjects/oce/lib/oce-0.16" would duplicate path, file already has LC_RPATH for: Users/Brky/Documents/Practices/openSourceProjects/oce/lib/oce-0.16 So it is still not working – Wilmort Aug 27 '15 at 18:54

0 Answers0