Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to install a C based toolbox on Matlab software. To do this, I should install GCC compiler. I think I have done that already. And also I have Xcode too.

To setup the toolbox I need to write "mex -setup;" in matlab command window. I've got the following warning and dont know who to solve it:

Warning: Xcode is installed, but its license has
not been accepted. Run Xcode and accept its
license agreement.

Error using mex
No supported compiler or SDK was found. For
options, visit 
http://www.mathworks.com/support/compilers/R2014a/maci64.
share|improve this question
    
What version of Xcode is in play here? What OS X build? Are both from the Mac App Store? – bmike Mar 3 '15 at 0:56
    

In Terminal:

sudo xcodebuild -license

which should view/accept it on behalf of all accounts on that particular Mac.

share|improve this answer
1  
Running xcodebuild -license from the command line (without sudo) yields the error Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo., so I think the sudo is needed. – D.W. Dec 23 '15 at 0:24
3  
In recent XCode versions you can also use sudo xcodebuild -license accept to avoid manual input. – Ohad Schneider Feb 2 at 13:04
1  
@OhadSchneider Thanks for the tip. I wonder exactly what purpose this serves, legally.. Not that people actually read the ToS, but XCode having something where you can set up a script to blindly accept a legal agreement makes it feel like it'd be hard to actually enforce the terms in court. – Andrew Theken Mar 25 at 12:57

You need to start/open Xcode once to accept the license agreement. Easiest way to run the application is by clicking on the Spotlight icon on top right and just type its name.

share|improve this answer
1  
I've opened it already. But I didn't ask me anything. :( I also, created a project too. @patrix – Electricman Mar 2 '15 at 16:30
1  
@Electricman If you open terminal and type these two commands what are your results? sudo xcode-select -r and sudo xcode-select --install (and if it says you should run Software Update, check there are no Xcode pending updates with sudo softwareupdate -l – bmike Mar 2 '15 at 16:41
    
I wrote sudo xcode-select -r and sudo xcode-select --install and a window has been appeared saying the xcode selected command requires the command line developer tools. would u like to install the tools now with three button including, not now, get xcode and install. So, I selected install Xcode and accepted the licence, and then another boxed opened finding software that says cant install the software be it is not currently available from the software update server. what should I do? @bmike Also, sudo softwareupdate -l shows nothing about xcode needs for updates – Electricman Mar 2 '15 at 16:52
1  
@Electricman Odd - is this computer managed by a corporate IT department? Is your log in user an Admin user? If so, I'd make a new admin test account and re-run the Xcode commands - it could be simply your user or permissions are wonky. Hard to tell without sitting at that computer. The commands should get you all the permissions you need. Worst case, install all the updates and try again with the new user. – bmike Mar 2 '15 at 17:04
    
It is a Admin user. I made a new admin account but got a different error too. very bad situation @bmike – Electricman Mar 2 '15 at 17:27

You can also do this from the command line sudo xcrun cc

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.