6

I’m trying to use appledoc for one of my projects. I downloaded the project, built it in Xcode, and copied the appledoc binary into ~/bin. Trying to run the binary gives this error:

appledoc version: 2.1 (build 858)

!> dyld: Library not loaded: @rpath/DVTFoundation.framework/Versions/A/DVTFoundation
!> Referenced from: /usr/bin/xcrun
!> Reason: image not found
docsetutil failed to index the documentation set, continuing with what was indexed...

That’s the entirety of the output. I did a bunch of Googling and didn’t really find anything; I ended up deleting Xcode (version 4.6.3, from the Mac App Store) and reinstalling it. I rebuilt appledoc and tried again, but I got the same error.

I thought the problem might be that I also have the Xcode 5 developer preview installed, so I thought I’d use xcode-select to make sure that my build settings were sane. But running xcode-select -print-path gave me a similar error:

dyld: Library not loaded: @rpath/DVTFoundation.framework/Versions/A/DVTFoundation
  Referenced from: /usr/bin/xcode-select
  Reason: image not found
Trace/BPT trap

I have also tried building appledoc with Xcode 5, with the same results. Any idea what might be wrong here?


Edit: Here’s the output of otool -L ~/bin/appledoc:

bin/appledoc:
    /usr/lib/libicucore.A.dylib (compatibility version 1.0.0, current version 51.1.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1044.0.0)
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 20.0.0)
    /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (compatibility version 1.0.0, current version 596.2.0)
    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 59.0.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1242.0.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 844.0.0)

And otool -L /usr/bin/xcode-select:

/usr/bin/xcode-select:
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 945.0.0)
    @rpath/DVTFoundation.framework/Versions/A/DVTFoundation (compatibility version 1.0.0, current version 2091.0.0)
    @rpath/IDEFoundation.framework/Versions/A/IDEFoundation (compatibility version 1.0.0, current version 2102.0.0)
    @rpath/Xcode3Core.ideplugin/Contents/MacOS/Xcode3Core (compatibility version 1.0.0, current version 2110.0.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.0.0)
bdesham
  • 15,430
  • 13
  • 79
  • 123
  • Try making a directory at `/Developer` and then symlinking `Xcode.app` in the directory to the `Xcode.app` in `/Applications`. Not sure this will help, but there's still a lot of things out there that expect Xcode to be in `/Developer`, so it may help. – ipmcc Jul 19 '13 at 13:44
  • @ipmcc Yeah, but how could `xcode-select` not know about the new Xcode setup? I’ll give this a shot… – bdesham Jul 19 '13 at 13:58
  • I wonder if the `xcode-select` in `/usr/bin` is from an old Xcode... but yeah, that's weird. – ipmcc Jul 19 '13 at 14:01
  • I tried symlinking `/Developer` to `/Applications/Xcode.app/Contents/Developer`, and I tried creating a directory `/Developer` and making a symlink from `/Applications/Xcode.app` to `/Developer/Xcode.app`, but neither of those worked. – bdesham Jul 19 '13 at 15:37
  • I believe, from the error, that the binary is looking for the DVTFoundation framework and expecting it to be within the application bundle that the binary is residing in. However, if it's just a binary without a bundle, then the path is wrong (the @rpath...). You can use oTool with -L option on the binary to confirm that this is where its looking for the framework and install_name_tool to change it to where the framework is actually located. – TheDarkKnight Jul 19 '13 at 15:54
  • @Merlin069 I’ve included the `otool` output above. `appledoc` doesn’t seem to use `@rpath` at all, and I’m not sure what I should change the `rpath` to for `xcode-select`. Any pointers? – bdesham Jul 19 '13 at 16:50
  • In the output for xcode-select, the 3 path starting with @rpath is expecting those libraries to be located inside the app bundle of xcode-select. If this is not the case, you need to set them to their actual paths with install_name_tool, wherever that may be, or if you are using an app bundle, copy the libraries inside the bundle. – TheDarkKnight Jul 22 '13 at 07:29

1 Answers1

0

Just update your Xcode on App Store, if not already installed , install Xcode. Then execute

sudo xcodebuild -license

on terminal and accept this license.

vimuth
  • 5,064
  • 33
  • 79
  • 116