gpt4 book ai didi

c - 链接libsrtp问题

转载 作者:太空宇宙 更新时间:2023-11-04 08:54:01 25 4
gpt4 key购买 nike

我根据 read me 中的说明在我的 ubuntu 机器上安装了 libsrtp,测试工作正常,libsrtp 中包含的 rptw 实用程序也工作得很好。但是当我试图在我的 HelloWorld 中包含 srtp.h 时!程序,它给我一个错误:

fatal error: srtp.h: No such file or directory
compilation terminated.

具体来说,我的主文件是这个

#include "srtp.h"

int main()
{
return 0;
}

我的 libsrtp.a 存在于/usr/local/lib/lib 中

我使用了来自 this blog 的 gcc 语句:

gcc -static main.c -L/usr/local/lib/lib/ -llibsrtp -o main

如有任何帮助,我将不胜感激。

最佳答案

您已经找到了您的 libsrtp.a ,但是 srtp.h 在哪里?如果包含文件不在带有 -I 标志的标准位置,您需要告诉编译器在哪里搜索包含的文件。

也许你需要一个 -I/usr/local/include-I/usr/local/include/srtp

另请注意,-llibsrtp 可能是错误的,您需要提供不带 lib 前缀的名称。这就是 -lsrtp

关于c - 链接libsrtp问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18272704/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com