Unable to get MacPort functionality after installing Xcode 4.3

后端 未结 17 1891
野趣味
野趣味 2021-01-29 21:51

I am having trouble getting MacPorts to function properly. I just installed OSX Lion 10.7.3 I downloaded and installed MacPorts first, and then after reading the requirements, I

相关标签:
17条回答
  • 2021-01-29 22:30

    After

    sudo xcode-select -switch /Applications/Xcode.app
    

    I also had to run

    sudo xcodebuild -license
    

    and accept the licence

    0 讨论(0)
  • 2021-01-29 22:31

    I have macports installed without admin/root privileges, so I was unable to test the xcode-select answers. However, I observed that Pall Melsted's answer worked, but not initially. What I found out was that I had not accepted the Xcode 4.5 license agreement!

    If you have just installed Xcode for the purposes of macports, and you haven't accepted the Xcode license yet, you might get the error presented by the original post. When I checked my Xcode version using /usr/bin/xcodebuild -version, I was given the prompt to read and accept the license. After doing so, and after having made the changes suggested by Pall to the macports.conf developer_dir, it all works now.

    0 讨论(0)
  • 2021-01-29 22:31

    I had initially installed xcode 3.2.2, after which I installed 4.3. When I ran the xcode-select, I still got the same error about no xcode project in /Applications. I then dug into the /usr/bin/xcodebuild script and found out that this was working correctly, and another instance of xcodebuild (the one installed with xcode 4.3, not the one in /usr/bin) was being run and returning the error:

    xcodebuild: error: The directory /Applications does not contain an Xcode project.

    It seems the /usr/bin/xcode-select does not work for xcode 4.3, (it's compiled so you can't really see why it's not working). Strings doesn't give any clues. Good thing osx has strace.. oh wait.

    Anyways, the best I could do was modify /opt/local/etc/macports.conf and uncomment the line containing the path to the xcode installation. That seems to fix my problem for the most part.

    0 讨论(0)
  • 2021-01-29 22:33

    Starting with Xcode 4.3, the command-line build tools are not installed by default. Launch Xcode, open the Preferences, and go to the Downloads tab. From there you should have an option to install the command-line tools.

    You can also download them from the web here: https://developer.apple.com/downloads/index.action

    Disclaimer: I haven't installed Xcode 4.3 yet. I have only read about it on the web.

    0 讨论(0)
  • 2021-01-29 22:34

    None of this works for me. Wait for macports to release a new version that officially supports XCode 4.3+

    0 讨论(0)
  • 2021-01-29 22:36

    As of 27/2/2012, the official suggestion from MacPorts seems to be to not use XCode 4.3 and instead use 4.1 through 4.2.1, which can be downloaded from Apple.

    There is a bug ticket which might be useful to follow the evolution of this.

    Incidentally, and as reported in my comment #11 in that bug report, I am able to build ports without warnings by using the 2 most sane-looking suggestions found in this question: sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer and changing developer_dir in /opt/local/etc/macports/macports.conf to /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain

    0 讨论(0)
提交回复
热议问题