Setting Up Gmock to QT (Windows) - qt

I'm trying unit testing using QT Creator. I tried doing it with linux and it works really fine, but when I start doing it in Windows. I discover the setting up is way different than what I did to linux.
Right now in my Windows QT Creator, I already set up gtest to my project. Everything is working fine until I started to set up googlemock. Can someone tell me how to set up googlemock in QT Creator? (windows)
I added some gmock files in the sources in my .pro file just like what I did to the gtest files. Also, I already add some library like libgmock.a and libgmock_main.a.
Here's the image of the issue results Qt
INCLUDEPATH += "gtest/include/"
INCLUDEPATH += "gtest/"
INCLUDEPATH += "../../"
INCLUDEPATH += "gmock/include/gmock/"
INCLUDEPATH += "gmock/include/"
INCLUDEPATH += "gmock/"
INCLUDEPATH += "../../"
FORMS += \
../calculator.ui
HEADERS += \
../calculator.h \
../button.h
SOURCES += \
../calculator.cpp \
../button.cpp \
main.cpp \
gtest/src/gtest-typed-test.cc \
gtest/src/gtest-test-part.cc \
gtest/src/gtest-printers.cc \
gtest/src/gtest-port.cc \
gtest/src/gtest-filepath.cc \
gtest/src/gtest-death-test.cc \
gtest/src/gtest-all.cc \
gtest/src/gtest.cc \
gmock/src/gmock-spec-builders.cc \
gmock/src/gmock-matchers.cc \
gmock/src/gmock-cardinalities.cc \
gmock/src/gmock-all.cc \
gmock/src/gmock.cc \
gmock/src/gmock-internal-utils.cc
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../Gmock_lib/ -lgmock_main
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../Gmock_lib/ -lgmock_maind
else:unix: LIBS += -L$$PWD/../../../Gmock_lib/ -lgmock_main
INCLUDEPATH += $$PWD/../../../Gmock_lib
DEPENDPATH += $$PWD/../../../Gmock_lib
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../Gmock_lib/ -lgmock
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../Gmock_lib/ -lgmockd
else:unix: LIBS += -L$$PWD/../../../Gmock_lib/ -lgmock
INCLUDEPATH += $$PWD/../../../Gmock_lib
DEPENDPATH += $$PWD/../../../Gmock_lib
main.cpp
#include <gtest/gtest.h>
#include <QApplication>
#include "Calculator/calculator.h"
#include "Calculator/button.h"
#include "Calculator/calculator.h"
#include <gmock/gmock.h>
TEST (sumInMemory, clearMemoryF) {
calculator cal;
double x = cal.sumInMemory;
EXPECT_EQ( x , 0.0);
}
TEST (functionTest, Subtest1) {
calculator cal;
int x = cal.equalClicked();
EXPECT_NE( x , -1);
}
TEST (functionTest, Subtest2) {
calculator cal;
double x = cal.factorSoFar;
EXPECT_EQ( x , 0.0);
}
int main (int argc, char *argv[])
{
QApplication a(argc, argv);
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

I experienced the same problem, I suggest you to download other version of gmock. In my case I use gmock 1.7.0. Some older version have some problems/issues. Just follow what the compiler says to you.
Fix bug one step at a time

My new .pro file
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += console c++14
INCLUDEPATH += "gmock/include/"
INCLUDEPATH += "gmock/"
INCLUDEPATH += "gtest/include/"
INCLUDEPATH += "gtest/src/"
INCLUDEPATH += "gtest/"
INCLUDEPATH += "../../"
FORMS += \
../calculator.ui
HEADERS += \
../calculator.h \
../button.h \
SOURCES += \
../calculator.cpp \
../button.cpp \
main.cpp \
gtest/src/gtest.cc \
gtest/src/gtest-all.cc \
gtest/src/gtest-death-test.cc \
gtest/src/gtest-filepath.cc \
gtest/src/gtest-port.cc \
gtest/src/gtest-printers.cc \
gtest/src/gtest-test-part.cc \
gtest/src/gtest-typed-test.cc
and the items inside my src file are
gmock-spec-builders.cc
gmock-matchers.cc
gmock-internal-utils.cc
gmock-cardinalities.cc
gmock-all.cc
gmock-main.cc
gmock.cc
note: I only use src and include for my gtest and gmock for my test file.
I hope this would help others

Related

qmake cannot find include files

I'm using QtCreator with qmake and have set up my .pro file:
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
DEFINES += QT_DEPRECATED_WARNINGS
CONFIG += staticlib
INCLUDEPATH += /usr/include/eigen3
INCLUDEPATH += /opt/userlibs
INCLUDEPATH += /opt/QcustomPlot/qcustomplot
INCLUDEPATH += /carbonics/owncloudsync/programs/C++/cmos_modeling_tests
INCLUDEPATH += /carbonics/owncloudsync/programs/C++/libraries/plotting/smithchart
INCLUDEPATH += /carbonics/owncloudsync/programs/C++/libraries/utilities
INCLUDEPATH += /opt/pagmo/include
PRECOMPILED_HEADER += /opt/userlibs/*
PRECOMPILED_HEADER += /usr/include/eigen3/Eigen/*
PRECOMPILED_HEADER += /opt/QcustomPlot/qcustomplot/*
SOURCES += \
# ../libraries/plotting/smithchart/colorlineedit.cpp \
# ../libraries/plotting/smithchart/plotcurve.cpp \
# ../libraries/plotting/smithchart/plotrectactions.cpp \
# ../libraries/plotting/smithchart/plotsmithactions.cpp \
../libraries/plotting/smithchart/autolineedit.cpp \
# ../libraries/plotting/smithchart/directoryselector.cpp \
../libraries/utilities/fileselector.cpp \
../libraries/utilities/formatnum.cpp \
../libraries/utilities/getfilenames_unbiased.cpp \
../libraries/utilities/getfilenames_vgs_vds.cpp \
# ../libraries/utilities/getspar.cpp \
../libraries/utilities/linearregression.cpp \
../libraries/utilities/readallSpar.cpp \
../libraries/utilities/readsparameters.cpp \
../libraries/utilities/readwritedefault.cpp \
../libraries/utilities/sparfilenames.cpp \
../libraries/utilities/utilities.cpp \
../libraries/utilities/writespar.cpp \
/opt/QcustomPlot/qcustomplot/qcustomplot.cpp \
/carbonics/owncloudsync/programs/C++/cmos_modeling_tests/optimizer_test.cpp \
/carbonics/owncloudsync/programs/C++/cmos_modeling_tests/readsparameters_test.cpp \
cmosmodel1.cpp \
getmodelelements.cpp \
main.cpp \
cmosmodelingmainwindow.cpp \
modelcircuitelements.cpp \
optimizer_test.cpp \
problemcmosactivebias.cpp
HEADERS += \
# ../libraries/plotting/smithchart/colorlineedit.h \
# ../libraries/plotting/smithchart/plotcurve.h \
# ../libraries/plotting/smithchart/plotrectactions.h \
# ../libraries/plotting/smithchart/plotsetup.h \
# ../libraries/plotting/smithchart/plotsmithactions.h \
../libraries/plotting/smithchart/autolineedit.h \
# ../libraries/plotting/smithchart/directoryselector.h \
../libraries/utilities/fileselector.h \
../libraries/utilities/formatnum.h \
../libraries/utilities/getfilenames_vgs_vds.h \
../libraries/utilities/getfilenames_unbiased.h \
# ../libraries/utilities/getspar.h \
../libraries/utilities/linearregression.h \
../libraries/utilities/pagmosetup.h \
../libraries/utilities/readallSpar.h \
../libraries/utilities/readsparameters.h \
../libraries/utilities/readwritedefault.h \
../libraries/utilities/sparfilenames.h \
../libraries/utilities/utilities.h \
../libraries/utilities/writespar.h \
../libraries/utilities/qtsetup.h \
\
/opt/QcustomPlot/qcustomplot/qcustomplot.h \
/carbonics/owncloudsync/programs/C++/cmos_modeling_tests/optimizer_test.h \
/carbonics/owncloudsync/programs/C++/cmos_modeling_tests/readsparameters_test.h \
cmosmodel1.h \
cmosmodelingmainwindow.h \
getmodelelements.h \
modelcircuitelements.h \
modeldatatypes.h \
optimizer_test.h \
problemcmosactivebias.h
FORMS += \
../libraries/plotting/smithchart/plotsmithdialog.ui \
../libraries/plotting/smithchart/plotxydialog.ui \
CMOSmodlingmainwindow.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../opt/pagmo/lib/release/ -lpagmo
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../opt/pagmo/lib/debug/ -lpagmo
else:unix: LIBS += -L$$PWD/../../../../../opt/pagmo/lib/ -lpagmo
INCLUDEPATH += $$PWD/../../../../../opt/pagmo/include
DEPENDPATH += $$PWD/../../../../../opt/pagmo/include
QtCreator can find the files optimizer_test.cpp, optimizer_test.h, readsparameters_test.cpp, and readsparameters_test.h just fine
However, when I invoke qmake from QtCreator, it cannot find the above *.h files.
I've carefully checked that these files are in the specified directories, but qmake keeps throwing the errors that it cannot find these files. qmake finds all the other include files just fine. I can't for the life of me understand why qmake is failing - a real mystery. I've tried removing the build directories as well as cleaning the project.
I've tried uncommenting the DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000
line but it did not help.
Thanks,
Phil
Sorry! I found my stupid mistake!
I had added the "optimizer_test.h" and "optimizer_test.cpp" twice in two different directories. Previously, I had moved the above files from the root sources directory to /carbonics/owncloudsync/programs/C++/cmos_modeling_tests.
Of course, QtCreator tried to find them in the original sources directory to no avail and hence my error messages!
Sorry again to waste your time and thanks!
Phil

Qt compile error : glib/galloca.h not found in glib-2.0/glib.h

I've the following error during Qt compiling phase :
In file included from ../test_ble2/main.cpp:12:
/opt/fsl-imx-xwayland/5.10-hardknott/sysroots/cortexa53-crypto-poky-linux/usr/include/glib-2.0/glib.h:30:10: fatal error: glib/galloca.h: No such file or directory
30 | #include <glib/galloca.h>
compilation terminated.
make: *** [Makefile:723: main.o] Error 1
looking for *.h and I found it on the board so the problem seems in *.pro file :
QT += quick
LIBS += -lbluetooth
LIBS += -lpython3
LIBS += -llibglib-2.0
SOURCES += \
main.cpp
RESOURCES += qml.qrc
QML_IMPORT_PATH =
QML_DESIGNER_IMPORT_PATH =
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
packagesExist(glib-2.0) {
CONFIG += link_pkgconfig
PKGCONFIG += glib-2.0
}
HEADERS += \
include/gattlib.h
unix:!macx: LIBS += -L$$PWD/lib/ -lgattlib
INCLUDEPATH += $$PWD/include
DEPENDPATH += $$PWD/include
but I' dont fix it, any suggestion?
The platform is yocto form imx8.
Any suggestion? Thanks in advance

Why lupdate not include qml qstr string into .ts file?

I have this .pro file :
TEMPLATE = subdirs
SUBDIRS += internal app
app.depends = internal
app.subdir = src/app
internal.subdir = src/internal
TRANSLATIONS = \
$$PWD/translations/croatian.ts \
$$PWD/translations/danish.ts \
$$PWD/translations/english.ts \
$$PWD/translations/french.ts \
$$PWD/translations/german.ts \
$$PWD/translations/italian.ts \
$$PWD/translations/norwegian.ts \
$$PWD/translations/portuguese.ts \
$$PWD/translations/romanian.ts \
$$PWD/translations/spanish.ts
internal.pro is this:
TEMPLATE = lib
TARGET = internal
CONFIG += c++1z
QT += core core-private gui quick serialport sql multimedia
DEFINES += CURRENT_PATH=\\\"$$PWD\\\"
CONFIG(release, debug|release) {
CONFIG += qtquickcompiler
QMAKE_CXXFLAGS += -O3
}
CONFIG(debug, debug|release) {
QMAKE_CXXFLAGS += -O0
QMAKE_CXXFLAGS -= -O1
QMAKE_CXXFLAGS -= -O2
QMAKE_CXXFLAGS -= -O3
QMAKE_CXXFLAGS += --debug
}
#MS_SKELETON_MODULES = core utils network
#include($$PWD/../external/ms-skeleton/ms-skeleton.pri)
include($$PWD/aggiornamento/aggiornamento.pri)
include($$PWD/allarmi/allarmi.pri)
include($$PWD/comunicazione/comunicazione.pri)
include($$PWD/core/core.pri)
include($$PWD/jsoncpp/jsoncpp.pri)
include($$PWD/mqtt/mqtt.pri)
include($$PWD/other/other.pri)
include($$PWD/parametri/parametri.pri)
include($$PWD/programs/programs.pri)
include($$PWD/serializer/serializer.pri)
unix: target.path = /opt/Tagliavini/lib
!isEmpty(target.path): INSTALLS += target
and app.pro is this :
TEMPLATE = app
TARGET = UserInterface
CONFIG += c++1z
QT += core gui quick sql multimedia
DEFINES += CURRENT_PATH=\\\"$$PWD\\\"
CONFIG(release, debug|release) {
CONFIG += qtquickcompiler
QMAKE_CXXFLAGS += -O3
}
CONFIG(debug, debug|release) {
QMAKE_CXXFLAGS += -O0
QMAKE_CXXFLAGS -= -O1
QMAKE_CXXFLAGS -= -O2
QMAKE_CXXFLAGS -= -O3
QMAKE_CXXFLAGS += --debug
}
LIBS += -L$$shadowed($$PWD)/../internal/ -linternal
INCLUDEPATH += \
$$PWD/../internal \
$$PWD/../external/ms-skeleton
SOURCES += $$PWD/main.cpp
RESOURCES += \
$$PWD/../../font/fonts.qrc \
$$PWD/../../images/images.qrc \
$$PWD/qml/qml.qrc \
$$PWD/../../sounds/sounds.qrc
unix: target.path = /opt/Tagliavini/bin
!isEmpty(target.path): INSTALLS += target
when i try to create file .ts with lupdate , the files are generated correctly , but the file .ts not cointeins the qstr strings that are into qml files. ( the file qml are into app.pro ), instead the string that i want to translate into .cpp files are all recognized correctly and put into .ts file.(these are into internal.pro) Where is the problem??
It seems that you are including your .qml files in .qrc resources but not in the project SOURCES itself. lupdate will not pick/parse your .qrc files to list .qml files.
So, you will have to add your .qml files to SOURCES either one-by-one or per directory.
lupdate_only{
SOURCES+=example.qml
SOURCES+=app/FancyControls/*.qml
}
This will duplicate your QML file entries in Qt Creator project pane tree which is not very desirable. So, you can comment out those lines in your .pro file and uncomment it before any lupdate. It's also mandatory to fence those imports in lupdate_only{} conditional statement. Make sure that there is no space between lupdate_only and the curly bracket. Actually, your C/C++ compiler would not expect a qml file to be compiled.

Error integrating NCRport 2.10.0 with Qt 5.1.0

i start integerating NCReport to my application , but alway i got these errors
her is my .pro file
#-------------------------------------------------
#
# Project created by QtCreator 2013-08-14T17:44:33
#
#-------------------------------------------------
QT += core gui sql xml
greaterThan(QT_MAJOR_VERSION, 4){
QT += widgets printsupport
DEFINES += HAVE_QT5
}
TARGET = gestionstock6
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
produit.cpp \
customqtablewidget.cpp \
customdelegatecombobox.cpp \
customproxy.cpp \
client.cpp \
bondelivraison.cpp \
chercherproduit.cpp \
chercherclientproduitwidget.cpp \
fournisseur.cpp \
chercherfournisseur.cpp \
vente.cpp
HEADERS += mainwindow.h \
customqtablewidget.h \
customdelegatecombobox.h \
customproxy.h \
client.h \
bondelivraison.h \
chercherproduit.h \
produit.h \
produit.h \
produit.h \
chercherclientproduitwidget.h \
fournisseur.h \
chercherfournisseur.h \
vente.h
FORMS += mainwindow.ui \
produit.ui \
client.ui \
bondelivraison.ui \
chercherproduit.ui \
chercherclientproduitwidget.ui \
fournisseur.ui \
chercherfournisseur.ui \
vente.ui
INCLUDEPATH = "E:\apprendreQt\gestionstock6\includes\include"
LIBS = "E:\apprendreQt\gestionstock6\includes\lib\NCReport2.lib"
and this is my implementation of ncreport
void Vente::on_pushButton_4_clicked()
{
NCReport *report = new NCReport(this);
report->reset(true);
report->setReportFile("E:\apprendreQt\build-gestionstock6-Desktop_Qt_5_1_0_MinGW_32bit-Debug\reports\abdeu.xml");
report->runReportToQtPreview();
}
when i compile my project files , i got errors below
i have tried many times but same problem
E:\apprendreQt\gestionstock6\vente.cpp:222: erreur : undefined reference to `_imp___ZN8NCReport5resetEb'
E:\apprendreQt\gestionstock6\vente.cpp:223: erreur : undefined reference to `_imp___ZN8NCReport13setReportFileERK7QString'
E:\apprendreQt\gestionstock6\vente.cpp:225: erreur : undefined reference to `_imp___ZN8NCReport20runReportToQtPreviewEv'
collect2.exe:-1: erreur : error: ld returned 1 exit status
It looks like you're using incompatible libraries.
This tells me that you're using the MinGW compiler
report->setReportFile("E:\apprendreQt\build-gestionstock6-Desktop_Qt_5_1_0_MinGW_32bit-Debug\reports\abdeu.xml");
but in your .pro file, you're including a static linking library from a different compiler (most likely MS Visual Studio)
LIBS = "E:\apprendreQt\gestionstock6\includes\lib\NCReport2.lib"
libraries for MinGW should have a .a extension, not a .lib one.
Not only that, you're using the LIBS variable incorrectly. For a MinGW compiler, you should specify the library path(with -L) and the library itself(with -l) separately.
You could do this on separate lines:
LIBS += "-L/path/to/libraries"
LIBS += "-lmylibrary.a"
or in a single line:
LIBS += "-L/path/to/libraries -lmylibrary.a"

Compiling qt project with use of ffmpeg on x64 system

I have a qt project that uses some ffmpeg functionality, that i have compiled previously on windows (x86) and ubuntu. However, its x86 binaries do not work correctly on x64 windows machine. I have tried compiling it but have run into a strange problem.
All ffmpeg functions i use are listed as unresolved exgternals; and the most pecicular thing is, their names all ahve a leading underscore attached to them (so, avformat_close_input -> _avformat_close_input etc). To be sure, i have downloaded latest ffmpeg libraries for x64 machines and run them through a dependency walker - no leading underscores anywhere.
How to fix this problem?
Here is my .pro file:
#-------------------------------------------------
#
# Project created by QtCreator 2013-05-17T10:55:01
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = LPR_Demo
TEMPLATE = app
# The application version
VERSION = 1.0
# Define the preprocessor macro to get the application version in our application.
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
SOURCES += main.cpp\
mainwindow.cpp \
imgProcessor.cpp \
qpicturelabel.cpp \
aboutdialog.cpp \
state.cpp \
qt_videoreader.cpp \
roidialog.cpp \
recognitionresult.cpp \
ffmpeg_reader.cpp \
label_videoplayer.cpp
HEADERS += mainwindow.h \
imgProcessor.h \
qpicturelabel.h \
aboutdialog.h \
state.h \
qt_videoreader.h \
roidialog.h \
recognitionresult.h \
global.h \
ffmpeg_reader.h \
label_videoplayer.h
FORMS += mainwindow.ui \
aboutdialog.ui \
roidialog.ui
LPRDIR = $$PWD/LPR
win32: LIBS += -L$$LPRDIR/bin/ -lliblpr
unix:LIBS += -L$$LPRDIR/bin -lLPR
INCLUDEPATH += $$LPRDIR/include
DEPENDPATH += $$LPRDIR/include
INCLUDEPATH += $$PWD/
DEPENDPATH += $$PWD/
#OTHER_FILES += \
# ffmpeg.pri
include(ffmpeg.pri)
#LIBS += -lavformat -lavcodec -lavutil -lswscale
RESOURCES += \
lpr_Res.qrc
win32 {
dlls_to_move.path += $$OUT_PWD/bin
dlls_to_move.files += $$LPRDIR/bin/liblpr.dll
QTDIR=C:/Qt/4.8.4/
CONFIG (debug, debug|release) {
dlls_to_move.files += $$QTDIR/bin/QtCored4.dll \
$$QTDIR/bin/QtGuid4.dll
}
CONFIG (release, debug|release) {
dlls_to_move.files += $$QTDIR/bin/QtCore4.dll \
$$QTDIR/bin/QtGui4.dll
}
img_format.path += $$OUT_PWD/bin/imageformats
CONFIG (debug, debug|release) {
img_format.files += $$QTDIR/plugins/imageformats/qgifd4.dll \
$$QTDIR/plugins/imageformats/qicod4.dll \
$$QTDIR/plugins/imageformats/qjpegd4.dll \
$$QTDIR/plugins/imageformats/qmngd4.dll \
$$QTDIR/plugins/imageformats/qsvgd4.dll \
$$QTDIR/plugins/imageformats/qtgad4.dll \
$$QTDIR/plugins/imageformats/qtiffd4.dll
}
CONFIG (release, debug|release) {
img_format.files += $$QTDIR/plugins/imageformats/qgif4.dll \
$$QTDIR/plugins/imageformats/qico4.dll \
$$QTDIR/plugins/imageformats/qjpeg4.dll \
$$QTDIR/plugins/imageformats/qmng4.dll \
$$QTDIR/plugins/imageformats/qsvg4.dll \
$$QTDIR/plugins/imageformats/qtga4.dll \
$$QTDIR/plugins/imageformats/qtiff4.dll
}
ffmpeg_dll.path += $$OUT_PWD/bin
ffmpeg_dll.files += $$FFMPEG_LIBRARY_PATH/avutil-*.dll \
$$FFMPEG_LIBRARY_PATH/avcodec-*.dll \
$$FFMPEG_LIBRARY_PATH/avformat-*.dll \
$$FFMPEG_LIBRARY_PATH/swscale-*.dll
main_exe.path += $$OUT_PWD/bin
CONFIG (debug, debug|release) {
main_exe.files += $$OUT_PWD/debug/LPR_Demo.exe
}
CONFIG (release, debug|release) {
main_exe.files += $$OUT_PWD/release/LPR_Demo.exe
}
INSTALLS += dlls_to_move img_format ffmpeg_dll main_exe
}
unix {
CONFIG (release, debug|release) {
QMAKE_PRE_LINK += rm LPR_Demo_cmpr LPR_Demo$$escape_expand(\n\t)
QMAKE_POST_LINK += upx -9 -oLPR_Demo_cmpr LPR_Demo$$escape_expand(\n\t)
QMAKE_POST_LINK += cp -v -u LPR_Demo_cmpr $$OUT_PWD/../artifacts/examples/qt_demo/bin/unix
}
}
and here is pri file for ffmpeg:
# Include the configuration file below in the QT .pro file, and modify the path accordingly.
# ##############################################################################
# ##############################################################################
# FFMPEG: START OF CONFIGURATION BELOW ->
# Copy these lines into your own project
# Make sure to set the path variables for:
# 1) ffmpeg_reader,
# 2) FFMPEG include path (i.e. where the directories libavcodec, libavutil, etc. lie),
# 3) the binary FFMPEG libraries (that must be compiled separately).
# Under Linux path 2 and 3 may not need to be set as these are usually in the standard include and lib path.
# Under Windows, path 2 and 3 must be set to the location where you placed the FFMPEG includes and compiled binaries
# Note that the FFMPEG dynamic librairies (i.e. the .dll files) must be in the PATH
# ##############################################################################
# ##############################################################################
# ##############################################################################
# Modify here: set FFMPEG_LIBRARY_PATH and FFMPEG_INCLUDE_PATH
# ##############################################################################
# Set FFMPEG_LIBRARY_PATH to point to the directory containing the FFmpeg import libraries (if needed - typically for Windows), i.e. the dll.a files
win32:FFMPEG_LIBRARY_PATH = $$PWD/ffmpeg/lib
unix: FFMPEG_LIBRARY_PATH = /usr/local/lib
# Set FFMPEG_INCLUDE_PATH to point to the directory containing the FFMPEG includes (if needed - typically for Windows)
win32:FFMPEG_INCLUDE_PATH = $$PWD/ffmpeg/include
unix:FFMPEG_INCLUDE_PATH = /usr/local/include
# ##############################################################################
# Do not modify: FFMPEG default settings
# ##############################################################################
# Set list of required FFmpeg libraries
#unix:LIBS += -L$$FFMPEG_LIBRARY_PATH
unix:LIBS += -lavformat -lavcodec -lavutil -lswscale
# Add the path
win32:LIBS += -L$$FFMPEG_LIBRARY_PATH
win32:LIBS += -lavformat -lavcodec -lavutil -lswscale
INCLUDEPATH += $$FFMPEG_INCLUDE_PATH
# Requied for some C99 defines
DEFINES += __STDC_CONSTANT_MACROS
# ##############################################################################
# FFMPEG: END OF CONFIGURATION
# ##############################################################################

Resources