Sign up ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm writing an OpenGL application in C++ using Xcode 4 on Lion. To load textures, and keep the application platform independent, I plan on using DevIL.

To install DevIL on my mac I ran ./configure and noticed gcc was no longer on the $PATH. I created a symlink from /Developer/usr/bin/gcc-4.2 to /usr/bin. Then I re-ran ./configure, it now finds gcc but fails with this:

checking for gcc... gcc
checking for C compiler default output file name... 
configure: error: C compiler cannot create executables

I'm not sure what this means:

  • Shouldn't I have symlinked gcc?
  • Do I need another gcc?
  • Is the problem DevIL related?

Thanks in advance

share|improve this question
On my Mac Xcode did link gcc-4.2 into /usr/bin (I did upgrade from Xcode 3.x and SL) – Mark Sep 3 '11 at 22:33

1 Answer 1

up vote 1 down vote accepted

As for your first question: The cleaner alternative to symlinking would be to add /Developer/usr/bin to your $PATH, so the other utilities needed for compilation can be found. That's easy to do:

export PATH=$PATH:/Developer/usr/bin

You could put that into ~/.profile so the path get set each time you open a terminal window.

And I'm certainly not a GCC/LLVM expert, but to me it seems like DevIL's configure script does expect a different version of gcc, one which doesn't expect an argument to the -V switch. My best bet would be to ask around on the DevIL developer's mailing list, as there probably are people who have been confronted with the same problem.

share|improve this answer
Thank you for answering @Kiezpro. I added '/Developer/usr/bin' to the PATH, that does indeed seem like a better alternative. I did however find another problem: trying to compile a simple Hello World in C, the compiles fails to find stdio.h ... How can I fix this? Maybe the original problem has nothing to do with DevIL but with a badly configured compiler?! – João Silva Sep 4 '11 at 17:43
Actually, there's a similar thread on Stack Overflow:… So setting C_INCLUDE_PATH=/Developer/usr/include seems to solve that problem. Maybe instead of trying to set up your compilation environment on the command line, it would be easier to import the project into XCode and compile it from there? – Kiezpro Sep 5 '11 at 19:21

Your Answer


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.