Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to `av_get_cpu_flags' on GNU/Linux distros #2

Open
EXL opened this issue Mar 10, 2014 · 1 comment
Open

undefined reference to `av_get_cpu_flags' on GNU/Linux distros #2

EXL opened this issue Mar 10, 2014 · 1 comment

Comments

@EXL
Copy link

@EXL EXL commented Mar 10, 2014

I compiled ffmpeg with static versions of the libraries.
On the linking step I received the following errors:

/usr/local/lib/libswscale.a(swscale.o): In function `emms_c':
/home/exl/Build/client_linux_x86_2.2.0/ffmpeg/./libavutil/x86/emms.h:37: undefined reference to `av_get_cpu_flags'
/usr/local/lib/libswresample.a(resample.o): In function `multiple_resample':
/home/exl/Build/client_linux_x86_2.2.0/ffmpeg/libswresample/resample.c:315: undefined reference to `av_get_cpu_flags'
/usr/local/lib/libswresample.a(resample.o): In function `emms_c':
/home/exl/Build/client_linux_x86_2.2.0/ffmpeg/./libavutil/x86/emms.h:37: undefined reference to `av_get_cpu_flags'
collect2: error: ld returned 1 exit status
make: *** [Linux/BBQScreenClient2] Error 1

Please fix gcc linker library order

In your BBQScreenClient2.linux.pro file:

LIBS += -lavutil \
    -lavcodec \
    -lavformat \
    -lswscale \
    -lswresample \
    -lz

But we need to (re-order):

LIBS += -lswresample \
    -lavcodec \
    -lavformat \
    -lavutil \
    -lswscale \
    -lz

Patch:

diff --git a/BBQScreenClient2.linux.pro b/BBQScreenClient2.linux.pro
index 225095f..ab034d0 100644
--- a/BBQScreenClient2.linux.pro
+++ b/BBQScreenClient2.linux.pro
@@ -26,11 +26,11 @@ include(BBQScreenClient2.pri)
 LIBS += -L/usr/local/lib

 # Set list of required FFmpeg libraries
-LIBS += -lavutil \
+LIBS += -lswresample \
     -lavcodec \
     -lavformat \
+    -lavutil \
     -lswscale \
-    -lswresample \
     -lz

 # Requied for some C99 defines

raw patch

@miguelcobain
Copy link

@miguelcobain miguelcobain commented Feb 23, 2015

This fixed my compilation process after compiling ffmpeg from source.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants