Search code examples
macososx-snow-leopard

How to get blocks/grand central dispatch working in Snow Leopard


How do I get blocks/grand central dispatch working in Snow Leopard? It appears that the library is not installed by default: when I try to do #include <dispatch/dispatch.h>, I get a library not found error.

I have tried making the source I found here: http://libdispatch.macosforge.org/ but it generated an error (internal.h:99:27: error: Block_private.h: No such file or directory + others), but I am not even sure if that is the correct source to use. Any pointers on how to get this to work are appreciated.


Solution

  • You shouldn't have to compile anything special to get dispatch.h. In fact, library not found implies that it's a linking error, not anything to do with dispatch.h itself.

    For the record, dispatch.h is located at: /Developer/SDKs/MacOSX10.6.sdk/usr/include/dispatch/dispatch.h

    Can we see the exact error message? Something doesn't make sense here.