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



Question:

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:1

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.


Solution:2

Check that the project is set to use the 10.6 SDK.


Solution:3

You have to change the current SDK for your project, because Grand Central Dispatch is only working on Snow Leopard.

Go to Project > Edit Project Settings > General

At the bottom of the window you have to change the

Base SDK for All Configurations: to Mac OS X 10.6.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »