Linking Error

Discussion in 'Mac Programming' started by joesc, Nov 10, 2009.

  1. macrumors newbie

    Hello everyone,

    I am trying to build a program called polyworld (developed by larry yeager: and after many failed attempts on Linux, I had a go at it on a mac.

    Well, after overcoming many other obstacles I clicked build in xcode, waited for it to compile source files, and then proceeded to get and error stating:
    Command /usr/bin/g++-4.0 failed with exit code 1
    it happens when it is linking. I have talked to Mr. Yeager himself and he has no idea even after 3 screenshots and many e-mails.
  2. macrumors 603


    What was the error or warning message you got before that was shown?

    Which version of Xcode are you using?
  3. macrumors newbie

    Sorry I took so long to reply!

    Here are the messages before the error:

    /usr/bin/ld: /Library/Frameworks/QtCore.framework/QtCore load command 4 unknown cmd field
    /usr/bin/ld: /Library/Frameworks/QtGui.framework/QtGui load command 5 unknown cmd field
    /usr/bin/ld: /Library/Frameworks/QtOpenGL.framework/QtOpenGL load command 5 unknown cmd field
    I am in Xcode 2.1

  4. macrumors 603


    Which version of Mac OS X? Xcode 2.1 is pretty darn old. Any chance of upgrading to Xcode 2.5?

    The load command seems to be a way to load binary code so it looks like the command specifying what to load is borked for some reason. I'm not entirely sure what the solution to this issue might be I'm afraid.

    Let me know what happens after you have got a more recent version of Xcode up and running.
  5. macrumors 603

    Any time there are "unknown load command" errors, it strongly suggests the target library or framework has been compiled for a later version of the OS than the referrer can handle. For example, a lib compiled for 10.5 being linked with the linker on 10.4.

    I don't know what load commands 4 or 5 are, off the top of my head. But if you're using Xcode 2.1, you need to upgrade. Either that, or you need to get the source for the target dylibs and recompile everything under Xcode 2.1. Don't be surprised if that won't work: it's quite likely the target libs contain API calls only available on recent OS versions.

Share This Page