c - 未定义的引用 C 文件

标签 c undefined-reference

我在 github 上的 libnfc 项目上使用:

当我尝试编译这个文件时

https://github.com/nfc-tools/libnfc/blob/master/examples/pn53x-diagnose.c

我收到错误 undefined reference to pn53x_transceive'

上线106+117线

为什么?第 53 行是 #include "libnfc/chips/pn53x.h" 并在此文件上: https://github.com/nfc-tools/libnfc/blob/master/libnfc/chips/pn53x.h 我有这个函数(第305行):

int    pn53x_transceive(struct nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx, uint8_t *pbtRx, const size_t szRxLen, int timeout);

请问我能做什么? 谢谢!

最佳答案

您知道声明 pn53x_transceive 函数接口(interface)的头文件。现在您需要找出哪个文件包含该函数的实现,并将该文件(可能是一个库)链接到您的可执行文件。

关于c - 未定义的引用 C 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44835419/

相关文章:

c - C语言对文件的读写

c - 将指针数组分配给数组

C 错误 : undefined reference to function, 但已定义

C - 使用 char 指针打印 int 值,未得到预期结果

c - 结构填充信息

c++ - 未定义对静态成员中类静态成员的引用

c++ - 静态变量 - undefined reference

c++ - 错误 LNK2019 错误 C++

c - 如何在 C 字符串中使用美元符号?

linux - Crypto++ 在 Qt Creator 中导致 undefined reference ,但在 code::blocks 中没有