Results 1 to 2 of 2

Thread: linking problem (own build libavformat)

  1. #1
    Join Date
    Oct 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default linking problem (own build libavformat)

    Hi!

    I'd like to use libavformat and libavcodec in my app.
    I need the newest, but it isn't in repository (I use ubuntu 11.04), so I built one. I'd like to use it from myapp-build/lib .

    I include headers in my cpp:

    Qt Code:
    1. extern "C"
    2. {
    3. #include "include/libavcodec/avcodec.h"
    4. #include "include/libavformat/avformat.h"
    5. }
    To copy to clipboard, switch view to plain text mode 

    and I put these rows to my .pro file:
    Qt Code:
    1. INCLUDEPATH += $$PWD/include
    2. DEPENDPATH += $$PWD/include
    3.  
    4. unix:LIBS += -Llib/ -lavcodec
    5. unix:LIBS += -Llib/ -lavformat
    To copy to clipboard, switch view to plain text mode 

    but it still use the older libs.
    I tried it with absolute path too.
    What should I do?
    I use QtCreator and I checked LD_LIBRARY_PATH in the run settings.
    Last edited by entee; 5th October 2011 at 19:35. Reason: spelling corrections

  2. #2
    Join Date
    Oct 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: linking problem (own build libavformat)

    Solution:
    Qt Code:
    1. LIBS += -L/dir/of/my/lib \
    2. -l:libavutil.so.51.9.1 \
    3. -l:libavformat.so.53.4.0 \
    4. -l:libavcodec.so.53.7.0
    To copy to clipboard, switch view to plain text mode 

    I use opencv, and it's highgui modul used the older avcodec. I have to give the full file name of the libs.

Similar Threads

  1. Qt linking problem
    By LovesTha in forum Newbie
    Replies: 3
    Last Post: 31st March 2009, 00:31
  2. Dll linking problem
    By Skizmo in forum Qt Programming
    Replies: 2
    Last Post: 8th February 2008, 10:56
  3. Linking problem
    By prosass in forum Newbie
    Replies: 3
    Last Post: 2nd March 2007, 13:22
  4. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 22:41
  5. linking problem
    By high_flyer in forum Qt Programming
    Replies: 2
    Last Post: 7th August 2006, 15:30

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.