July 5, 2012

umaiuma umaiuma
Lab Rat
1 posts

runtime error when linking ffmpeg libraries in qt creator

 

Hello, I’m new around here and around qt development.

For the last few days I’ve been fiddling around with opengl and the like, trying to write a video player.

However, when i try to import the ffmpeg libraries (avcodec, avformat, avutils etc), an error occurs on runtime (the program compiles fine). When compiled and run in debug mode, the error message gives me only a memory address and error code 135 (DLL not found).

This error occurs when i include a function from those libraries in my code (e.g. av_register_all()) and it occurs regardless of whether the function is actually called.

So i’m thinking that I’m doing something wrong when linking these libraries.
I’m currently using:
Windows vista (32bit),
Qt creator 2.4.1 based on Qt 4.7.4 (32bit),
Zeranoe’s FFmpeg build git-3233ad4 (2012-06-30)

My .pro file consists of:

  1. QT       += core gui opengl
  2.  
  3. TARGET = test
  4. TEMPLATE = app
  5.  
  6.  
  7. SOURCES += main.cpp\
  8.         mainwindow.cpp \
  9.     glwidget.cpp
  10.  
  11. HEADERS  += mainwindow.h \
  12.     glwidget.h \
  13.  
  14. FORMS    += mainwindow.ui
  15.  
  16.  
  17. LIBS += -L"$$_PRO_FILE_PWD_/libraries/ffmpeg/libs/" -lavcodec -lavformat -lavutil
  18. INCLUDEPATH += libraries/ffmpeg/includes

I’ve tried many variations to the LIBS += line and checked my filepath many times. However, the DLL not found error occurs in all of these variations =(.

Is there something I’m forgetting when doing these includes?

Thanks in advance >.<,
(young and naive) aspiring dev

2 replies

July 26, 2012

Volker Volker
Robot Herder
5428 posts

On Windows, a DLL must be accessible at runtime. Either by putting it into some system directory or some other folder that is in PATH, or by putting it into the same directory where the .exe is. Did you do that?

July 28, 2012

Hostel Hostel
Hobby Entomologist
185 posts

Another reason of this issue could be a dependencies from ffmpeg. Try check dependencies of dlls by Dependency Walker.

 
  ‹‹ how to compile qt code with g++?      Qt windows ce and OpenGl support ››

You must log in to post a reply. Not a member yet? Register here!