 |
 |
Help! Problem linking to Kernel.framwork
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Sep 2000
Location: Medford, MA
Status:
Offline
|
|
I'm writing a gui-less server app with complicated threading and I need access to atomic integer operations. On MacOS X these seemed to be as follows decared in <kern/simple_lock.h>:
int hw_atomic_add(int *area, int inc);
int hw_atomic_sub(int *area, int dec);
unsinged int hw_compare_and_store(unsigned int oldValue, unsigned int newValue, unsigned int *area);
These would be all I need, however, I can't seem to link to the Kernel.framworks. I include it in my project builder project, but I get:
"ld: can't locate framework for: -framwork Kernel"
I don't think it's a search path issue. I've tried explicitly including /System/Library/Framworks but to no avail. Also, I have no trouble linking to openssl.framwork.
What don't I know? I could use mutexes to get around the atomic op issue, but frankly OS X is slow enough. ;-)
I also wish the pthreads implementation was a bit more full featured. I know it meets the spec, but it's hard to deal with if you're porting from platforms with nicities like pthread_suspend and pthread_resume, or god-forbid, recursive mutexes.
I wish my company would shell out for a nice ADC membership, but they're still not sold on OS X yet as a target platform. The port is my personal work.
Thanks in advance!
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2001
Status:
Offline
|
|
Hey-
I've had the same problem as well trying to compile a few apps. AFAIK, there is no real Kernel.framework library. Normally inside a framework you have a <framework>.framework/<framework> file, where <framework> is the name of the framework (did I say "framework" enough times?). Anyway, AFAICT, that is the library for the framework. Kernel.framework does not have it, so my advice is to go into Kernel.framework/Headers, and search through the headers there for the functions you need.
Hope this helps.
mccullocht
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Sep 2000
Location: Medford, MA
Status:
Offline
|
|
hmm... interesting...
This would kinda make sense. I found the header. It's /System/Library/Frameworks/Kernel.frameworks/Headers/kern/simple_lock.h. If I just include that header, it tells me it can't find the code for the functions. I have to link against some library where they are defined. I'll keep poking around. Grr...
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Sep 2000
Location: Medford, MA
Status:
Offline
|
|
Maybe these functions are just for programming in kernel space? Eeek, that would be lousy.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2001
Status:
Offline
|
|
Hmm...you may very well be correct in your assessment that they are kernel-only functions. But you might also want to check out /usr/lib/libSystem.dylib. It's got several main libs compiled into it (libcurses, libm, and more), so this might have the functions you are looking for. It that doesn't work, try looking through apple's kernel docs, which are buried under /System/Library/Frameworks/Kernel.framework/Versions/A/Resources/English.lproj/Documentation/Reference/Kernel .
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Sep 2000
Location: Medford, MA
Status:
Offline
|
|
No joy there. But thanks for trying.
I guess I'll just use a mutex. 
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|