简体   繁体   English

C ++中的ffmpeg“在此范围内未声明av_register_all”

[英]ffmpeg in C++ “av_register_all not declared in this scope”

I'm trying to compile this simple program in C++ (in Code Blocks): 我正在尝试使用C ++(在代码块中)编译此简单程序:

#ifdef __cplusplus
extern "C" {
    #endif
    #include <libavutil/avutil.h>
    #include <libavcodec/avcodec.h>
#ifdef __cplusplus
};
#endif

int main(int argc, char *argv[]) {
    av_register_all();
    return 0;
}

However I keep getting the error message: |11|error: 'av_register_all' was not declared in this scope| 但是,我不断收到错误消息:| 11 |错误:在此范围内未声明'av_register_all'|

Other people seem to have had this problem and adding the extern "C" section seems to have solved it form them but not me. 其他人似乎遇到了这个问题,添加extern "C"部分似乎已经解决了他们的问题,但我却没有。 Does anyone have any suggestions? 有没有人有什么建议?

Thanks 谢谢

Did you set up your additional libraries / additional include files? 您是否设置了其他库/其他包含文件? Here you can find how to do it in MSVC++, I have used CodeBlocks a little & never included an external library to it, however I think you should be able to adopt it to CodeBlocks. 在这里,您可以找到如何在MSVC ++中做到这一点,我使用了CodeBlocks很少,并且从未在其中包含外部库,但是我认为您应该能够将其应用于CodeBlocks。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM