LWHLOVECD 2021-09-02 14:49 采纳率: 0%
浏览 139

ffmpeg中未定义标识符AVCodecParameters,



```c++

#pragma once 
extern  "C" {

#include <libavformat/avformat.h>
#include<libavcodec/avcodec.h>

}

class MMAVStreamPrivate {
public:
    
    
    AVCodecParameters* codecpar=nullptr;//此处报错,未定义标识符AVCodecParameters
};

引用了#include <libavformat/avformat.h> #include<libavcodec/avcodec.h>头文件,而且我在这几个 头文件里面没找 到这个标识符 ,所以有没有人知道这个定义在哪个文件里面,还是版本不对?

  • 写回答

1条回答 默认 最新

  • 刘不刘 2021-09-02 17:41
    关注
    1. 有可能后台没有这个库,或者引用路径错误。
    2. 如果有这个库,那么有可能这个.h文件原来是用C写的。C++中要是用的话要换种方式。
      #define __STDC_CONSTANT_MACROS

    #ifdef _WIN32
    //Windows
    extern "C"
    {
    #include "libavformat/avformat.h"
    };
    #else
    //Linux...
    #ifdef __cplusplus
    extern "C"
    {
    #endif
    #include <libavformat/avformat.h>
    #ifdef __cplusplus
    };
    #endif
    #endif
    请把上述代码将你的#include <libavformat/avformat.h>替换试一试

    评论

报告相同问题?

问题事件

  • 创建了问题 9月2日

悬赏问题

  • ¥15 vscode的问题提问
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM