2012-03-28 44 views
1

克恩/ task.h,我發現聲明:如何解決鏈接器錯誤「架構i386的未定義符號來自:」_current_task「」?

__BEGIN_DECLS 
extern task_t current_task(void); 
extern void task_reference(task_t task); 
__END_DECLS 

但是,當我打電話在iPhone應用程序功能current_task()。 我得到的鏈接錯誤如:

Undefined symbols for architecture i386 from: 
"_current_task", referenced from:.... in xxx.o 
ld: symbol(s) not found for architecture i386 
collect2: ld returned 1 exit status 

如何解決此問題?

回答

0

一個簡單的解決方案: 使用mach_task_self()來取代函數current_task。仍然可以返回一個指向與當前正在運行的內核線程關聯的任務結構的指針。

但我仍想解決上述問題:(

相關問題