21

I'm in the process of installing XCode Command Line Tools onto OSX 10.9 Mavericks

I did a successful install XCode:

$ xcode-select -p 
/Library/Developer/CommandLineTools 

However when I type in either $ clang or $ gcc it returns:

clang: error: no input files 
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
user2925321
  • 233
  • 1
  • 2
  • 4

6 Answers6

9

If you just type the command without any input files, then as commented, the compiler reports an accurate error message.

But if you have an existing project, then you can see that same "clang: error: no input files" message when:


The OP user2925321 comments:

The error was that I was running through steps to configure ruby and was directed to instructions on another page that just stated to check for $ gcc instead of $ gcc --version.
Obviously new to coding, trying to learn more.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 2
    The error was that I was running through steps to configure ruby and was directed to instructions on another page that just stated to check for $ gcc instead of $ gcc --version. Obviously new to coding, trying to learn more. This was helpful, thanks! – user2925321 Oct 29 '13 at 01:29
  • @user2925321 good feedback, thank you. I have included your conclusion in the answer for more visibility. – VonC Oct 29 '13 at 06:32
9

Try gcc -v. I am on a Mac (Mavericks) and that worked for me. It will tell you which version you are using (and you will know it is installed).

Geert Wille
  • 1,656
  • 13
  • 18
Christy Byrne
  • 91
  • 2
  • 2
9

I faced the same issue. Type in xcode-select --install. It will work.

AMIC MING
  • 6,306
  • 6
  • 46
  • 62
Gautam Jain
  • 2,913
  • 30
  • 25
0

Another possibility: double check how the file in question is added to the xcode project. In my case, the file was set to "relative to group" instead of "relative to this project" and it was causing this error.

puzzl
  • 833
  • 9
  • 19
0

just type gcc -v which will spit an output specifying the prefix flag with which gcc was installed and the LLVM version as well. Specifying gcc on the command line without an option will report the issue you say it is reporting because its not able to find a file to compile using gcc.

AnkitSablok
  • 3,021
  • 7
  • 35
  • 52
0

I was seeing this error while setting up a React Native project. Here is what worked for me.

sudo xcode-select --switch /Applications/Xcode.app
Nelu
  • 16,644
  • 10
  • 80
  • 88