LRResty icon indicating copy to clipboard operation
LRResty copied to clipboard

Linker error and compile warnings in Xcode 4.3.2 on Lion for arcified branch

Open daj opened this issue 14 years ago • 1 comments

I downloaded the arcified branch of LRResty and imported the files into my Xcode project.

On build, I'm seeing these warnings :

-Implicit declaration of function 'DEFINE_SHARED_INSTANCE_USING_BLOCK' is invalid in C99 -Control reaches end of non-void function

They relate to this function in LRResty.m:

    + (LRRestyClient *)client;
    {
      DEFINE_SHARED_INSTANCE_USING_BLOCK(^{
        return [self newClient];
     });
    }

This then results in a linker error:

Undefined symbols for architecture i386: "_DEFINE_SHARED_INSTANCE_USING_BLOCK", referenced from: +[LRResty client] in LRResty.o ld: symbol(s) not found for architecture i386

Have I done something wrong? Are there any prerequisites that I've missed (I can't see any documented anywhere), e.g. minimum iOS target version (mine is 4.0), frameworks to link with, etc?

The All-Seeing I post (http://allseeing-i.com/%5Brequest_release%5D) said this arcified branch is an active project. Is it?

Thanks!

daj avatar Apr 14 '12 20:04 daj

you probably need this define

#define DEFINE_SHARED_INSTANCE_USING_BLOCK(block)
static dispatch_once_t pred = 0;
__strong static id _sharedObject = nil;
dispatch_once(&pred, ^{
_sharedObject = block();
});
return _sharedObject; \

pctj101 avatar Nov 18 '12 17:11 pctj101