Mac Can't compile under Leopard (no C++ compiler?)?

msharp

macrumors regular
Original poster
Jul 10, 2004
209
0
Hy folks, I was trying to compile a php under terminal, leopard.

However, it ended up like this:

checking whether the C++ compiler (c++ ) works... no
configure: error: installation or configuration problem: C++ compiler cannot create executables.

I've installed developer tools (xcode) that came with leopard disc.

I could do this when I was under Tiger...

Any clues? Thanks!
 

cmaier

macrumors P6
Jul 25, 2007
16,082
12,335
California
Hy folks, I was trying to compile a php under terminal, leopard.

However, it ended up like this:

checking whether the C++ compiler (c++ ) works... no
configure: error: installation or configuration problem: C++ compiler cannot create executables.

I've installed developer tools (xcode) that came with leopard disc.

I could do this when I was under Tiger...

Any clues? Thanks!
this was running ./configure?
 

msharp

macrumors regular
Original poster
Jul 10, 2004
209
0
this was running ./configure?
Yes, I was running ./configure

Both of my powerbook and my macbook pro won't compile. Same error.

It seems that the c++ compiler in 10.5 has been changed?
 

cmaier

macrumors P6
Jul 25, 2007
16,082
12,335
California
Yes, I was running ./configure

Both of my powerbook and my macbook pro won't compile. Same error.

It seems that the c++ compiler in 10.5 has been changed?
it changed, but it should still work. probably just a minor change in the configure script is needed.

What's the code look like in the configure where it is generating that message?
 

JasonHears

macrumors newbie
Oct 28, 2007
4
0
try exporting cflags

I just had this problem (which is how I came to this page, thanks Google). After playing a bit, I found something that worked for me. I did:

export CFLAGS="-arch i386"

Then I ran configure again (for me it was PHP5), and it worked. Hope that helps someone else out there! :)
 

msharp

macrumors regular
Original poster
Jul 10, 2004
209
0
I just had this problem (which is how I came to this page, thanks Google). After playing a bit, I found something that worked for me. I did:

export CFLAGS="-arch i386"

Then I ran configure again (for me it was PHP5), and it worked. Hope that helps someone else out there! :)
Thanks Jason!! I'll try whenever I got home!
 

msharp

macrumors regular
Original poster
Jul 10, 2004
209
0
Thanks Jason:

Thanks for the tip and now I can configure without a problem! Hooray!

But now I can't make. (I'm building PHP 5.2.4 on Leopard, MBP SR 2.2).

It will report undefined symbols: _iconv_close and _iconv_open.

I guess it could possibly because I was using the fink lib which was compiled under tiger, intel mac.

But as fink doesn't support Leopard, how am I supposed to compile the GD library as well as the zlib, libgpng and libjpeg?

Thanks!
 

Eraserhead

macrumors G4
Nov 3, 2005
10,410
10,905
UK
a) This should be in the programming forum (I've asked the mods to move it)

b) What did you install when you installed Xcode? Have you tried reinstalling it?
 

msharp

macrumors regular
Original poster
Jul 10, 2004
209
0
a) This should be in the programming forum (I've asked the mods to move it)

b) What did you install when you installed Xcode? Have you tried reinstalling it?
Thanks for moving it!

I surely did install both of the SDKs (10.4u and 10.5), and I did install the gcc's of course. So it shouldn't be missing some components from Xcode I guess.

And an update to my compile progress:
with the help of Jason: export CFLAGS="-arch i386" I've already been able to ./configure without a problem.
I've managed to install fink on 10.5, install the gd libs as well as the png and jpeg libs.

Now the problem is that I can't make (for PHP5). It will always fail with "undefined symbols" and there seems to be something wrong with iconv. The detailed error message can be found in the attached image.

This only happens when I compile with gd. That means if I skip the gd library when ./configure, it will make perfectly.

Any ideas?

Thanks!!
 

Attachments

Register on MacRumors! This sidebar will go away, and you'll see fewer ads.