Open KirillShirkunov opened 5 years ago
I have the same problem with Qt 5.12.1 on Windows. It was okay with Qt 5.12 but since upgrading to 5.12.1 my app linked to QtAV with QT += av
gives unresolved external symbol error where ever i have used QtAV. I have checked and all QtAV files are properly installed in Qt directory.
I have tested with Qt 5.12.2 and the problem exists. I managed to solve it by linking to QtAV lib directly via: LIBS += -L$$QT.core.libs -lQtAV1
Great solution, thanks! Maybe there is known what was changed in Qt 5.12.x?
I have no idea what could cause this problem. But it's clear that something is preventing QtAV from being known as a module named av
.
Thank you very much, this solved my problem. I use MinGW version of Qt and had the same problem, so it is related to Qt version, not the compiler.
However in my case the problem isn't solved completely. My app now compiles but crashes at runtime. I expect it can not load the libraries. How did you solve this?
Also in my case I had to modify the line
LIBS += -L$$QT.core.libs -lQtAV1
to
LIBS += -L$$QT.core.libs -lQtAV
Thank you
@javlada Try to copy QtAV and FFmpeg DLL files alongside your app exe.
@nejatafshar Yes, this solves the problem, but why do I have to do it if the libraries are in the same directory as other Qt libraries?
@javlada QtAV files are in Qt libs directory when it's built and installed. But FFmpeg files are not. You could also copy them in Qt dir to enable your apps run in Qt creator. Anyway you should copy QtAV and FFmpeg files alongside your app exe when deploying it.
@nejatafshar Also the ffmpeg files are int Qt lib directory. I copy them there when compiling QtAV. It wouldn't compile without them (or I would need to specify the path in QtAV). For deploying it is clear that I have to include all the libraries I use.
Now I run into a problem when compiling for Android. For Windows build I just copy all the needed QtAV libraries to the "release" directory where my .exe file is compiled. But how do I do it with Android build?
@javlada For android you should add the pathes for FFmpeg files built for the specific android architecture to ANDROID_EXTRA_LIBS
in your pro file :
ANDROID_EXTRA_LIBS = \
PathToFFmpegFiles/libavcodec.so \
PathToFFmpegFiles/libavdevice.so \
PathToFFmpegFiles/libavfilter.so \
PathToFFmpegFiles/libavformat.so \
PathToFFmpegFiles/libavutil.so \
PathToFFmpegFiles/libswresample.so \
PathToFFmpegFiles/libswscale.so
This way they would be bundled in the apk using androiddeployqt tool.
QtAV, Qt version and platform
QtAV 1.12.0, qt 5.12.1 (x86/x64), windows 10, msvc2017
Reproduction steps
Build QtAV from QtCreator, then run
sdk_install.bat
.Expected behavior
Project should be builded. Actually, this version QtAV was builded from sources with qt 5.9.0 and msvc2015. and project was successfully compiled with it.
Actual behavior
When I try to compile my app, there are some errors from linker:
Log of compile for demo app
Sample files (optional)
Demo project test.zip