Linking with pre-compiled object file

Hello, so I am working on integrating with the Key-Lok system to add hardware-based protection on our app, but I am having troubles linking with their supplied object file.

Basically it’s a .o file that defines a KFUNC function, that i am attempting to call.

In my class’s .h file, I have

  
  
extern unsigned long KFUNC(unsigned, unsigned, unsigned, unsigned);  
  

But the compiler complains that the symbol is undefined.

I know it’s something simple… I just can’t find where in the build settings to add it.

Oh yeah, I should mention that the kfunc32.o file I am trying to link with was provided as a C library… so there might be something I am missing to make it work in C++?

Ok, well I solved the problem related to kfunc32.o by adding this around the extern directive…

  
  
extern "C" {  
	extern unsigned long KFUNC(unsigned, unsigned, unsigned, unsigned);  
}  
  

Now I am getting errors that functions from the libusb.a needed by kfunc32.o aren’t defined.

I wonder if this is because I don’t have a header file for libusb?

ok… so apparently I was misreading the error messages… it was symbols called from libusb.a that were reported undefined.

Did a bit of research to find that I need the IOKit Framework. Added that to my project, and it compiles and runs! Woot!

Now to find out why the dongle is not being detected… But at least those nasty compile/link errors are now solved.

I got it all working now. Just had a stupid error from when I was adapting the Key-Lok demo program into a wrapper add-on. Will release an ofxKeyLok add-on shortly.

Those hardware locks are so awesome. I wish there was a preconfigured oF release … what about OpenFrameworks v0.07 ALCATRAZ …

@Plong0:
I find it rather insensitive to discuss copy protection on a forum which discusses a open source library.
If you have plans to incorporate this technique in your application (which imho you shouldn’t), please leave us ignorant :wink:

Hans Ruedisueli