編譯錯誤:AVFormatContext沒有名爲‘url’的成員

  • 錯誤如下:
avformat.c: 在函數‘mod_avformat_alloc_output_context2’中:
avformat.c:385:4: 錯誤:‘AVFormatContext’沒有名爲‘url’的成員
   s->url = strdup(filename);
  • 具體出錯的代碼
#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,7,100))
        av_strlcpy(s->filename, filename, sizeof(s->filename));
#else
        s->url = strdup(filename);
        switch_assert(s->url);
#endif

就是這個版本號判斷錯了。這個版本的定義:

https://blog.csdn.net/quantum7/article/details/106961024

  • 解決辦法

吾把代碼的判斷改了,順利編譯通過。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章