How to fix a specific OS X dynamic loader problem (dyld – 0x80000022)

The problem: You compile your C code on a OS X 10.6 machine like this:

gcc-4.2 -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk ...

When trying to run the executable on a OS X 10.5 machine, you may get this error:

Dyld Error Message:

unknown required load command 0x80000022

The reason is that OS X 10.5 doesn’t understand the load command  'LC_DYLD_INFO_ONLY' (0x80000022) that was used by the OS X 10.6 linker.

Solution: Make sure you are using a deployment target by setting the environment variable just before your link command:

export MACOSX_DEPLOYMENT_TARGET=10.5

(or   setenv MACOSX_DEPLOYMENT_TARGET=10.5)

You can always check the load commands of the executable like this:

(without using deployment target)
otool -l binary

Load command 4
cmd LC_DYLD_INFO_ONLY
cmdsize 48
rebase_off 0
rebase_size 0
bind_off 462848
bind_size 1320
weak_bind_off 0
weak_bind_size 0
lazy_bind_off 464168
lazy_bind_size 2624
export_off 466792
export_size 4568
(using deployment target)
otool -l binary

Load command 4
cmd LC_DYLD_INFO
cmdsize 48
rebase_off 0
rebase_size 0
bind_off 466944
bind_size 1400
weak_bind_off 0
weak_bind_size 0
lazy_bind_off 468344
lazy_bind_size 2656
export_off 471000
export_size 4568


Another solution:  Read this Intel article here – it may give you another possible solution.

Leave a Reply

Your email address will not be published. Required fields are marked *

IMPORTANT! To be able to proceed, please enter the magic word 'nagdae' so we know hat you are a human)

Enter the magic word:
Please leave these two fields as-is: