C program cannot find function which included in header file

只谈情不闲聊 提交于 2019-12-02 04:36:33

You have a linking error; not a compilation error. You will need to specify the library file by using -l option. I think it should be:

gcc getDuration.c -lavformat

If it does not work, specify the location of libavformat as

gcc -L/usr/local/lib getDuration.c -lavformat

I found what wrong with my code(exactly, not code, but environment).

To execute that code, I need extra library which named "libavformat-dev".

In my case, since I am Ubuntu 12.04 user, I commanded like below.

apt-get install libavformat-dev

such a shame on me :(

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!