Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. error: 'av_register_all' was not declared in this scope
Forum Updated to NodeBB v4.3 + New Features

error: 'av_register_all' was not declared in this scope

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 7.7k Views 1 Watching
  • 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 Offline
    V Offline
    vivekmalik2466
    wrote on last edited by
    #1

    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
    0
    • T Offline
      T Offline
      tucnak
      wrote on last edited by
      #2

      At first, we need your code.

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vivekmalik2466
        wrote on last edited by
        #3

        #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
        0
        • T Offline
          T Offline
          tucnak
          wrote on last edited by
          #4

          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
          0
          • T Offline
            T Offline
            tucnak
            wrote on last edited by
            #5

            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
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved