考虑以下代码片段:
#include <linux/interrupt.h>
DECLARE_TASKLET (test_tasklet, test_func, (unsigned long) &test_data);
从什么 ld
知道哪个 library
或 object-file
必须与我们的源文件链接?
最佳答案
from what ld does know which library or object-file must be linked with our source file?
事实并非如此。 您必须向链接器指定所需的库和目标文件。
您可能会想到 Microsoft #pragma comment(lib, ...)
,它在我所知道的任何其他编译器中都不存在。
关于linux - 包括 <linux/spinlock.h> 链接器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20879729/