0

I am trying to compile Indesign plugin code using Xcode 7.0 and MAC 10.10.5. But I am getting "ld: file not found: @executable_path/InDesignModel.framework/Versions/A/InDesignModel for architecture x86_64" error.

I have spent lot of time to resolve it without any luck.

halfer
  • 19,824
  • 17
  • 99
  • 186
Subodh Kumar
  • 229
  • 3
  • 8

2 Answers2

1

There is a missing library. Executables using dynamic libraries have both a list of those libraries, and possible paths to search when looking for them, called the run path list. The list of libraries can be either full or relative paths. If the paths are relative, the linker searches for them under each element of the run path list. (You can see the list of expected libraries with otool -L.)

The @executable_path is a variable that the dynamic linker replaces with the full path to the executable when doing this searching. So the linker is looking for the library at /path/to/App.app/Contents/MacOS/app_executable/InDesignModel.framework/Versions/A/InDesignModel, but it's not there.

The solution is to update the run time path list of the executable, using install_name_tool. You would do something like:

$ install_name_tool -add_rpath /path/to/InDesignModel app_binary

Alternatively, you can add to the @rpath directly during compilation, by adding the link flags -Wl,-rpath,/path/to/InDesignModel.

bnaecker
  • 6,152
  • 1
  • 20
  • 33
0

You need to explicitly link with the InDesignModel framework, make sure this:

-framework InDesignModel

Is in your link command. Or add InDesignModel.framework in Xcode.

This fixes it for me in Xcode 7 and it's a behaviour change from Xcode 6.

Sandy
  • 240
  • 3
  • 5