Skip to content
This repository has been archived by the owner on Jan 16, 2018. It is now read-only.

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

Open
daj opened this issue Apr 14, 2012 · 1 comment
Open

Comments

@daj
Copy link

daj commented Apr 14, 2012

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!

@pctj101
Copy link

pctj101 commented Nov 18, 2012

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; \

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants