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

Discussion in 'Mac Programming' started by msharp, Oct 26, 2007.

  1. macrumors regular

    msharp

    Joined:
    Jul 10, 2004
    #1
    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!
     
  2. macrumors G3

    Joined:
    Jul 25, 2007
    Location:
    California
    #2
    this was running ./configure?
     
  3. thread starter macrumors regular

    msharp

    Joined:
    Jul 10, 2004
    #3
    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?
     
  4. macrumors G3

    Joined:
    Jul 25, 2007
    Location:
    California
    #4
    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?
     
  5. macrumors newbie

    Joined:
    Oct 28, 2007
    #5
    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! :)
     
  6. thread starter macrumors regular

    msharp

    Joined:
    Jul 10, 2004
    #6
    Thanks Jason!! I'll try whenever I got home!
     
  7. thread starter macrumors regular

    msharp

    Joined:
    Jul 10, 2004
    #7
    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!
     
  8. macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #8
    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?
     
  9. thread starter macrumors regular

    msharp

    Joined:
    Jul 10, 2004
    #9
    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!!
     

    Attached Files:

Share This Page