bdkjones/VDKQueue

symbol(s) not found for architecture x86_64

arufian opened this issue · 6 comments

Hi

I trying to use VDKQueue, with XCode 4.3.3, OS X 10.7.4
I've tried use addPath method, and implement VDKQueueDelegate class with a callback method.
every time I try to run it I got a compile error :
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_VDKQueue", referenced from:
objc-class-ref in AppDelegate.o
(maybe you meant: OBJC_CLASS$_VDKQueueDelegate)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

just curious, can I use VDKQueue in 64 bit ?

Thanks,

Alfian

Of course. I use it in a 64-bit app myself.

This is very likely a case of user error. Did you correctly specify that your custom class acting as a delegate for a VDKQueue object conforms to the VDKQueueDelegate protocol?

Hmm...
Actually I did many things to fix this.

  • I setDelegate to self, I add the "-(void) VDKQueue:(VDKQueue )queue receivedNotification:(NSString)noteName forPath:(NSString*)fpath" to application delegate (went to compile error, the same error with this issue)
  • I create new Class named VDKQueueDelegate and make a implementation of above method, then setDelegate to this Class (still went to compile error)

FYI I still a beginner in objective C.

Yea. It's pretty obvious you're a beginner. None of what you did is correct.

Either show me your code so I can fix it for you or take it to another person who knows what they're doing. Either way, there is nothing wrong with VDKQueue.

I still a beginner in objective C.

Okay, I fix some but still error
I do this at application delegate :
id delegatee ;
DelegateSaya queueDelegate = [[DelegateSaya alloc] init];
delegatee = queueDelegate;
VDKQueue *vdkqueue = [[VDKQueue alloc] init];
[vdkqueue setDelegate:delegatee];
I create new file named DelegateSaya, containing :
DelegateSaya.h :
#import <Foundation/Foundation.h>
#import "VDKQueue.h"
@interface DelegateSaya : NSObject
@EnD
DelegateSaya.m :
#import "DelegateSaya.h"
@implementation DelegateSaya
-(void) VDKQueue:(VDKQueue *)queue receivedNotification:(NSString
)noteName forPath:(NSString*)fpath
{
// implementation on here
}
@EnD

Completely wrong.

You do not create a new object just to act as a delegate. Please read Apple's documentation on delegation and how to use it properly. Whatever object you're calling this from:

VDKQueue *queue = [[VDKQueue alloc] init];

is, generally, also the object you would use as the delegate for VDKQueue callbacks (although it does not have to be). But you would never create a new class just to act as the delegate.

So, right below the alloc/init line, you'd generally see:

queue.delegate = self;

and in the header file for this class, you'd import VDKQueue.h and specify that your class conforms to the VDKQueueDelegate protocol. The header would look like this:

#import "VDKQueue.h"

@interface myClass : NSObject <VDKQueueDelegate>
{
    VDKQueue *queue;    // here, the queue is an iVar so we can release it when we're done.

    // Other ivars...
}

// The delegate method required by VDKQueueDelegate Protocol
- (void) VDKQueue:(VDKQueue *)queue receivedNotification:(NSString*)noteName forPath:(NSString*)fpath;

@end

That's all I'm going to explain here. You need to educate yourself about the basics of Mac programming before attempting to file issues on code you don't understand.

Thanks. I got it.
Because before this I used UKKQueue smoothly, and then found that VDKQueue is faster.

Btw, my app is currently manage the big number of files (more than 1000), so I thought I can use Kernel Queue to do this, that finally I hit the max file open limit on mac. Do you know how to trick this one ?