链接libsrtp问题

时间:2013-08-16 11:52:32

标签: c linux gcc

我根据阅读中的指令在我的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

我将非常感谢任何帮助。

1 个答案:

答案 0 :(得分:2)

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

也许您需要-I/usr/local/include-I/usr/local/include/srtp

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

相关问题