linux - 包括 <linux/spinlock.h> 链接器

标签 linux header linker

考虑以下代码片段:

#include <linux/interrupt.h>
DECLARE_TASKLET (test_tasklet, test_func, (unsigned long) &test_data);

从什么 ld 知道哪个 libraryobject-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/

相关文章:

css - 如何在 Mediawiki 中跨部分继续编号列表

linker - CUDA:头文件中使用的 __device__ 函数上的 LNK2005 错误

linux - 告诉哪个版本的符号可用于链接(在 libc 中)?

linux - 用于选择最新镜像的 U-Boot 脚本

c - linux C语言。 setjmp longjmp 报警

c - 如何从 C 程序刷新 Linux 中的 CPU 缓存?

linux - 狂欢 : Search Contents of File A in File B and Print lines of File A in File C

c++ - 如何在我的主程序 C++ 中使用我自己制作的数组头文件?

Android 5.0 - 实现 Google Play 电影 Material 设计 "My movies"屏幕

c - __attribute__((section ("name"))) 用法?