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. Linking to libavcodec on Windows
Forum Updated to NodeBB v4.3 + New Features

Linking to libavcodec on Windows

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 2.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.
  • Chris HennesC Offline
    Chris HennesC Offline
    Chris Hennes
    wrote on last edited by
    #1

    I'm new to Windows programming, and am having some trouble getting my code to link. I'm trying to use the libavcodec library from the FFmpeg package. All of my source compiles fine, but when I go to link, all my avcodec calls are unresolved. In my .pro file I've got:

    win32: LIBS += -L$$PWD/../ffmpeg/win64/lib/ -lavcodec -lavutil
    
    INCLUDEPATH += $$PWD/../ffmpeg/win64/include
    DEPENDPATH += $$PWD/../ffmpeg/win64/include
    

    in the referenced lib directory I've got the download from the FFmpeg website containing the .lib and .dll.a files for avcodec and avutil. The linker doesn't tell me it can't find those libraries or that they are the wrong format, so I'm at a loss. Any idea what's going wrong? On Windows I don't even know how to begin debugging this issue.

    Chris Hennes, Pioneer Library System

    1 Reply Last reply
    0
    • Chris HennesC Offline
      Chris HennesC Offline
      Chris Hennes
      wrote on last edited by
      #2

      I'm going to answer my own question in case others are looking for this: I forgot to put my includes inside an extern "C" block, e.g.

      extern "C" {
          #include <libavutil/opt.h>
          #include <libavutil/imgutils.h>
          #include <libavcodec/avcodec.h>
      }
      

      Chris Hennes, Pioneer Library System

      1 Reply Last reply
      2

      • Login

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