Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    error: 'av_register_all' was not declared in this scope

    General and Desktop
    2
    5
    5847
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      vivekmalik2466 last edited by

      i am using ffmpeg lib but get --main.cpp:25: error: 'av_register_all' was not declared in this scope
      wt to do to avoid this.all ather thing r going we but ther is error in 'av_register_all' to register all files.

      1 Reply Last reply Reply Quote 0
      • T
        tucnak last edited by

        At first, we need your code.

        1 Reply Last reply Reply Quote 0
        • V
          vivekmalik2466 last edited by

          #include <QtGui/QApplication>
          #include "mainwindow.h"
          #include "ffmpeg.h"

          #include "iostream"
          using namespace std;

          extern "C" {
          #include "ffmpeg/libavcodec/avcodec.h"
          #include "ffmpeg/libavformat/avformat.h"
          }

          int main(int argc, char *argv[])
          {

          QApplication a(argc, argv);
          MainWindow w;
          w.show();
          
          av_register_all();
          
          return a.exec(&#41;;
          

          }

          1 Reply Last reply Reply Quote 0
          • T
            tucnak last edited by

            I will wrap it for you;)

            @
            #include <QtGui/QApplication>
            #include “mainwindow.h”
            #include “ffmpeg.h”
            #include “iostream”

            using namespace std;

            extern “C” {
            #include “ffmpeg/libavcodec/avcodec.h”
            #include “ffmpeg/libavformat/avformat.h”
            }

            int main(int argc, char *argv[])
            {
            QApplication a(argc, argv);
            MainWindow w;
            w.show();
            av_register_all();
            return a.exec(); }
            @

            1 Reply Last reply Reply Quote 0
            • T
              tucnak last edited by

              Problem in av_register_all().

              "It's not declared in this scope" - it mean that you don't include file with defenition of av_register_all().

              Maybe you should remove line #8 and #11 (in my wrapper).

              1 Reply Last reply Reply Quote 0
              • First post
                Last post