Apple Software www

Compile wget on Mac OS X

There’s a precompiled wget available on the net, but it’s not automatically accepting StartSSL’s certificates. And as it seems, there’s a wget update available that did.

This is what I had to do to compile it on my Macbook Pro;

  • Install Xcode, if you haven’t, and be sure to select UNIX Dev Support.

Or you’ll get this error:

configure: error: C compiler cannot create executables
  • Export Xcode’s gcc PATH:
  • Download wget
  • In Terminal: untar it
tar xvzf wget-latest.*
  • And compile it
cd wget directory
sudo make install
  • In case you had an old (precompiled) wget installed;
    remove that version first (/usr/bin/wget probably).
    By default, this one will install itself in /usr/local/bin/wget which should be in your $PATH as well (in case it’s not, make a symlink from the old /usr/bin/wget to /usr/local/bin/wget, or recompile with other installation directories).

4 replies on “Compile wget on Mac OS X”


I’m still getting the error message “configure: error: C compiler cannot create executables”, even if I set the correct PATH variable. I noticed that the “gcc” can be found.
Here is the detail:

“checking for gcc… gcc
checking whether the C compiler works… no
configure: error: in `/Users/cedar/wget-1.13.4′:
configure: error: C compiler cannot create executables
See `config.log’ for more details”

And I check the config.log and found the following snippet:

“configure:4339: gcc -V >&5
gcc-4.2: argument to `-V’ is missing
configure:4350: $? = 1
configure:4339: gcc -qversion >&5
i686-apple-darwin10-gcc-4.2.1: no input files
configure:4350: $? = 1
configure:4370: checking whether the C compiler works
configure:4392: gcc conftest.c >&5
ld: library not found for -lcrt1.10.6.o
collect2: ld returned 1 exit status
configure:4396: $? = 1
configure:4434: result: no”

I suspect the error has something to do with “ld: library not found for -lcrt1.10.6.o”. But I’m not sure what is going on. Can some one help me on this?

Thanks in advance!


Though things have changed since 2011, this blogpost helped me to get on the right track. Here’s a few updates notes for, as of writing, Xcode 4.4.1 running on Mac OS X 10.8.1 Mountain Lion:

* Start Xcode (get or update from the Mac App Store)
* Xcode menu: Preferences, Tab: Downloads
* Install “Command Line Tools”.

Also, the bin directory has changed location. It is no longer at /Developer/usr/bin. The new location (which should be in your Terminals’ PATH, instead of /Developer/usr/bin):


I originally pursued this to install wget. In the ./configure step it erred on:
> configure: error: C compiler cannot create executables

Going through the above solved that problem.

Leave a Reply...

%d bloggers like this: