I've been working around this problem for a while now and it's really driving me insane. Whenever I declare a block, I get a compile error in Xcode 4.1 compiling with LLVM GCC 4.2:
Redefinition of 'struct __block_literal_1'
Even examples of blocks copy-pasted from the documentation throw the error:
int multiplier = 7;
int (^myBlock)(int) = ^(int num) {
return num * multiplier;
};
I've had several attempts to find a solution to this error to no avail. Any help would be appreciated.
Update:
I know it's been a while since I posted, but I will need to tackle this problem sooner or later. I think this has something to do with using static libraries. When a static library with blocks are added to a project, the error is thrown. Will post more details soon.