1

I'm getting this error when I try and install node on my new mac

error: could not configure a cxx compiler!

The error always occurs when I get to the ./configure part of the installation

I found this problem which applies to a linux build with the same error, but the solution does not seem to apply in my case:

How to compile/install node.js(could not configure a cxx compiler!) (Ubuntu).

I also took a look at the troubleshoot guide on the node wiki here:

https://github.com/joyent/node/wiki/Troubleshooting-Installation

and tried this solution:

export PATH=/Developer/usr/bin:$PATH
ISYSROOT="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
export LINKFLAGS=$ISYSROOT CXXFLAGS=$ISYSROOT CFLAGS=$ISYSROOT
./configure --prefix=$HOME --without-ssl
make

But I get the same problem when I get to the ./configure step

Any advice, insights or help would be much appreciated here.

Thanks

Community
  • 1
  • 1
Ninjabiscuit
  • 134
  • 1
  • 10
  • 1
    Have you installed the command line utilities when installing Xcode? Also, config.log should have further information on why the build has failed — consider adding the relevant lines of config.log to your question. –  May 29 '11 at 11:29
  • why not to use homebrew? – NARKOZ May 29 '11 at 11:35

5 Answers5

4

When you install Mac OS X Developer Tools (XCode, etc) ensure you have the Unix Tools option checked. I had to remember to install Developer Tools/Unix tools when I set up my new MBP and it resolved this error for me.

Optionally, you could remove and try installing with Homebrew. However, it still has the same requirements (XCode/Dev Tools) so ensure that you have those installed.

Hope this helps.

  • Ah yes, you were absolutely right. In fact I had not installed xcode at all. As soon as the install finished I ran ./configure and everything worked fine. Thanks for your help Jayson! – Ninjabiscuit May 29 '11 at 15:17
  • You're welcome! One of those gotchas you can miss depending on the instructions. Glad I could help. – Jayson J. Phillips May 29 '11 at 17:38
3

I had this problem too, I resolved this in a different way, as far as I know xcode 4.3.1 doesnt come with an Install Xcode.app file from the appstore, if you are under this case, just run xcode, go to preferences -> downloads and click on the Install button for the command line tools option. I did just that and all the errors on the .configure and make commands were gone :)

Aldo Reyes
  • 515
  • 1
  • 4
  • 12
2

I had the same problem on OSX 10.7 with Xcode 4.2. I was trying to build node v0.4.7. I kept getting "unable to configure a c compiler" error. What finally worked for me is installing the GCC compiler seperately. I found a nice package for that here:

https://github.com/kennethreitz/osx-gcc-installer/

Joe
  • 1,043
  • 2
  • 12
  • 21
1

After installing XCode 4.3.2 (in Mac OS X Lion) I still had the error.

Open XCode, Preferences, Downloads and installed Command Line Tools. After it gets installed ./configure runs ok.

OmnipotentEntity
  • 16,531
  • 6
  • 62
  • 96
1

configure is currently broken for some versions of MacOS; for more details, see How to compile Node.js v0.4.2 on MacOS 10.5.8. The working approach cited there is as follows:

export PATH=/Developer/usr/bin:$PATH
ISYSROOT="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
export LINKFLAGS=$ISYSROOT CXXFLAGS=$ISYSROOT CFLAGS=$ISYSROOT
./configure --prefix=$HOME --without-ssl

make

This worked for me .

Al

alchuck
  • 11
  • 1