Compiling Qt projects on Ubuntu fails every time - qt

History
I've started mining on www.multiport.us and as such I am mining many different coins. Scrypt coins and sha-256.
I'd rather not have all my coins on Cryptsy or Vircuex, so I'm trying to get the Qt GUIs for each of the coins install compiled so I can have wallets on my PC.
Problem
I've been trying for several days now to get this stuff working and I just can't. I've tried with several different coins - Feathercoin, Novacoin, Namecoin, Worldcoin, Freicoin, Zetacoin, etc.
I have tried terminal, and Qt Creator, but I get different errors on each wallet, almost always missing program errors. I get missing bitcoin.cpp, missing QApplication, etc, etc. They just refuse to compile.
Fixes tried
In Qt Creator I have tried adding QT += Widgets, tried a couple of other things too.
In terminal I was originally using 'qmake', then 'make'. But that's been giving me various errors. Missing locale/****, or missing <QApplication>
I have been getting all my source files from the official SourceForge pages, and trying the latest releases and the "master" file list.
System
Ubuntu 13.10
qmake QMake version 3.0
Using Qt version 5.0.2 in /usr/lib/x86_64-linux-gnu
QTCreator version 2.7.1
Following the readme's and instructional files i have also installed the following dependancies
qt4-qmake
libqt4-dev
build-essential
libboost-dev
libboost-system-dev
libboost-filesystem-dev
libboost-program-options-dev
libboost-thread-dev \
libssl-dev
libdb++-dev
libminiupnpc-dev
libgmp3-dev
libmpfr-dev
I really don't know what the problem is. I'm guessing it has something to do with being on 13.10, either that or there is something major I'm just not seeing. But all the source files are the same, they are built so all you need to do is qmake and make, to compile on your own system and then run. But I'm just having no luck at all.
QT Creator is version 2.7.1 from the repository.
Here is the .pro file I'm using.
TEMPLATE = app
TARGET = bitcoin-qt
macx:TARGET = "Bitcoin-Qt"
VERSION = 0.8.3
INCLUDEPATH += src src/json src/qt
QT += network
DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
CONFIG += no_include_pwd
CONFIG += thread
# for boost 1.37, add -mt to the boost libraries
# use: qmake BOOST_LIB_SUFFIX=-mt
# for boost thread win32 with _win32 sufix
# use: BOOST_THREAD_LIB_SUFFIX=_win32-...
# or when linking against a specific BerkelyDB version: BDB_LIB_SUFFIX=-4.8
# Dependency library locations can be customized with:
# BOOST_INCLUDE_PATH, BOOST_LIB_PATH, BDB_INCLUDE_PATH,
# BDB_LIB_PATH, OPENSSL_INCLUDE_PATH and OPENSSL_LIB_PATH respectively
OBJECTS_DIR = build
MOC_DIR = build
UI_DIR = build
# use: qmake "RELEASE=1"
contains(RELEASE, 1) {
# Mac: compile for maximum compatibility (10.5, 32-bit)
macx:QMAKE_CXXFLAGS += -mmacosx-version-min=10.5 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk
macx:QMAKE_CFLAGS += -mmacosx-version-min=10.5 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk
macx:QMAKE_OBJECTIVE_CFLAGS += -mmacosx-version-min=10.5 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk
!win32:!macx {
# Linux: static link and extra security (see: https://wiki.debian.org/Hardening)
LIBS += -Wl,-Bstatic -Wl,-z,relro -Wl,-z,now
}
}
!win32 {
# for extra security against potential buffer overflows: enable GCCs Stack Smashing Protection
QMAKE_CXXFLAGS *= -fstack-protector-all
QMAKE_LFLAGS *= -fstack-protector-all
# Exclude on Windows cross compile with MinGW 4.2.x, as it will result in a non-working executable!
# This can be enabled for Windows, when we switch to MinGW >= 4.4.x.
}
# for extra security (see: https://wiki.debian.org/Hardening): this flag is GCC compiler-specific
QMAKE_CXXFLAGS *= -D_FORTIFY_SOURCE=2
# for extra security on Windows: enable ASLR and DEP via GCC linker flags
win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat
# on Windows: enable GCC large address aware linker flag
win32:QMAKE_LFLAGS *= -Wl,--large-address-aware
# use: qmake "USE_QRCODE=1"
# libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support
contains(USE_QRCODE, 1) {
message(Building with QRCode support)
DEFINES += USE_QRCODE
LIBS += -lqrencode
}
# use: qmake "USE_UPNP=1" ( enabled by default; default)
# or: qmake "USE_UPNP=0" (disabled by default)
# or: qmake "USE_UPNP=-" (not supported)
# miniupnpc (http://miniupnp.free.fr/files/) must be installed for support
contains(USE_UPNP, -) {
message(Building without UPNP support)
} else {
message(Building with UPNP support)
count(USE_UPNP, 0) {
USE_UPNP=1
}
DEFINES += USE_UPNP=$$USE_UPNP STATICLIB
INCLUDEPATH += $$MINIUPNPC_INCLUDE_PATH
LIBS += $$join(MINIUPNPC_LIB_PATH,,-L,) -lminiupnpc
win32:LIBS += -liphlpapi
}
# use: qmake "USE_DBUS=1"
contains(USE_DBUS, 1) {
message(Building with DBUS (Freedesktop notifications) support)
DEFINES += USE_DBUS
QT += dbus
}
# use: qmake "USE_IPV6=1" ( enabled by default; default)
# or: qmake "USE_IPV6=0" (disabled by default)
# or: qmake "USE_IPV6=-" (not supported)
contains(USE_IPV6, -) {
message(Building without IPv6 support)
} else {
count(USE_IPV6, 0) {
USE_IPV6=1
}
DEFINES += USE_IPV6=$$USE_IPV6
}
contains(BITCOIN_NEED_QT_PLUGINS, 1) {
DEFINES += BITCOIN_NEED_QT_PLUGINS
QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
}
INCLUDEPATH += src/leveldb/include src/leveldb/helpers
LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a
!win32 {
# we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences
genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a
} else {
# make an educated guess about what the ranlib command is called
isEmpty(QMAKE_RANLIB) {
QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
}
LIBS += -lshlwapi
genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
}
genleveldb.target = $$PWD/src/leveldb/libleveldb.a
genleveldb.depends = FORCE
PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a
QMAKE_EXTRA_TARGETS += genleveldb
# Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb ; $(MAKE) clean
# regenerate src/build.h
!win32|contains(USE_BUILD_INFO, 1) {
genbuild.depends = FORCE
genbuild.commands = cd $$PWD; /bin/sh share/genbuild.sh $$OUT_PWD/build/build.h
genbuild.target = $$OUT_PWD/build/build.h
PRE_TARGETDEPS += $$OUT_PWD/build/build.h
QMAKE_EXTRA_TARGETS += genbuild
DEFINES += HAVE_BUILD_INFO
}
QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector
# Input
DEPENDPATH += src src/json src/qt
HEADERS += src/qt/bitcoingui.h \
src/qt/transactiontablemodel.h \
src/qt/addresstablemodel.h \
src/qt/optionsdialog.h \
src/qt/sendcoinsdialog.h \
src/qt/addressbookpage.h \
src/qt/signverifymessagedialog.h \
src/qt/aboutdialog.h \
src/qt/editaddressdialog.h \
src/qt/bitcoinaddressvalidator.h \
src/alert.h \
src/addrman.h \
src/base58.h \
src/bignum.h \
src/checkpoints.h \
src/compat.h \
src/sync.h \
src/util.h \
src/hash.h \
src/uint256.h \
src/serialize.h \
src/main.h \
src/net.h \
src/key.h \
src/db.h \
src/walletdb.h \
src/script.h \
src/init.h \
src/bloom.h \
src/mruset.h \
src/checkqueue.h \
src/json/json_spirit_writer_template.h \
src/json/json_spirit_writer.h \
src/json/json_spirit_value.h \
src/json/json_spirit_utils.h \
src/json/json_spirit_stream_reader.h \
src/json/json_spirit_reader_template.h \
src/json/json_spirit_reader.h \
src/json/json_spirit_error_position.h \
src/json/json_spirit.h \
src/qt/clientmodel.h \
src/qt/guiutil.h \
src/qt/transactionrecord.h \
src/qt/guiconstants.h \
src/qt/optionsmodel.h \
src/qt/monitoreddatamapper.h \
src/qt/transactiondesc.h \
src/qt/transactiondescdialog.h \
src/qt/bitcoinamountfield.h \
src/wallet.h \
src/keystore.h \
src/qt/transactionfilterproxy.h \
src/qt/transactionview.h \
src/qt/walletmodel.h \
src/qt/walletview.h \
src/qt/walletstack.h \
src/qt/walletframe.h \
src/bitcoinrpc.h \
src/qt/overviewpage.h \
src/qt/csvmodelwriter.h \
src/crypter.h \
src/qt/sendcoinsentry.h \
src/qt/qvalidatedlineedit.h \
src/qt/bitcoinunits.h \
src/qt/qvaluecombobox.h \
src/qt/askpassphrasedialog.h \
src/protocol.h \
src/qt/notificator.h \
src/qt/paymentserver.h \
src/allocators.h \
src/ui_interface.h \
src/qt/rpcconsole.h \
src/version.h \
src/netbase.h \
src/clientversion.h \
src/txdb.h \
src/leveldb.h \
src/threadsafety.h \
src/limitedmap.h \
src/qt/splashscreen.h
SOURCES += src/qt/bitcoin.cpp \
src/qt/bitcoingui.cpp \
src/qt/transactiontablemodel.cpp \
src/qt/addresstablemodel.cpp \
src/qt/optionsdialog.cpp \
src/qt/sendcoinsdialog.cpp \
src/qt/addressbookpage.cpp \
src/qt/signverifymessagedialog.cpp \
src/qt/aboutdialog.cpp \
src/qt/editaddressdialog.cpp \
src/qt/bitcoinaddressvalidator.cpp \
src/alert.cpp \
src/version.cpp \
src/sync.cpp \
src/util.cpp \
src/hash.cpp \
src/netbase.cpp \
src/key.cpp \
src/script.cpp \
src/main.cpp \
src/init.cpp \
src/net.cpp \
src/bloom.cpp \
src/checkpoints.cpp \
src/addrman.cpp \
src/db.cpp \
src/walletdb.cpp \
src/qt/clientmodel.cpp \
src/qt/guiutil.cpp \
src/qt/transactionrecord.cpp \
src/qt/optionsmodel.cpp \
src/qt/monitoreddatamapper.cpp \
src/qt/transactiondesc.cpp \
src/qt/transactiondescdialog.cpp \
src/qt/bitcoinstrings.cpp \
src/qt/bitcoinamountfield.cpp \
src/wallet.cpp \
src/keystore.cpp \
src/qt/transactionfilterproxy.cpp \
src/qt/transactionview.cpp \
src/qt/walletmodel.cpp \
src/qt/walletview.cpp \
src/qt/walletstack.cpp \
src/qt/walletframe.cpp \
src/bitcoinrpc.cpp \
src/rpcdump.cpp \
src/rpcnet.cpp \
src/rpcmining.cpp \
src/rpcwallet.cpp \
src/rpcblockchain.cpp \
src/rpcrawtransaction.cpp \
src/qt/overviewpage.cpp \
src/qt/csvmodelwriter.cpp \
src/crypter.cpp \
src/qt/sendcoinsentry.cpp \
src/qt/qvalidatedlineedit.cpp \
src/qt/bitcoinunits.cpp \
src/qt/qvaluecombobox.cpp \
src/qt/askpassphrasedialog.cpp \
src/protocol.cpp \
src/qt/notificator.cpp \
src/qt/paymentserver.cpp \
src/qt/rpcconsole.cpp \
src/noui.cpp \
src/leveldb.cpp \
src/txdb.cpp \
src/qt/splashscreen.cpp
RESOURCES += src/qt/bitcoin.qrc
FORMS += src/qt/forms/sendcoinsdialog.ui \
src/qt/forms/addressbookpage.ui \
src/qt/forms/signverifymessagedialog.ui \
src/qt/forms/aboutdialog.ui \
src/qt/forms/editaddressdialog.ui \
src/qt/forms/transactiondescdialog.ui \
src/qt/forms/overviewpage.ui \
src/qt/forms/sendcoinsentry.ui \
src/qt/forms/askpassphrasedialog.ui \
src/qt/forms/rpcconsole.ui \
src/qt/forms/optionsdialog.ui
contains(USE_QRCODE, 1) {
HEADERS += src/qt/qrcodedialog.h
SOURCES += src/qt/qrcodedialog.cpp
FORMS += src/qt/forms/qrcodedialog.ui
}
contains(BITCOIN_QT_TEST, 1) {
SOURCES += src/qt/test/test_main.cpp \
src/qt/test/uritests.cpp
HEADERS += src/qt/test/uritests.h
DEPENDPATH += src/qt/test
QT += testlib
TARGET = bitcoin-qt_test
DEFINES += BITCOIN_QT_TEST
macx: CONFIG -= app_bundle
}
CODECFORTR = UTF-8
# for lrelease/lupdate
# also add new translations to src/qt/bitcoin.qrc under translations/
TRANSLATIONS = $$files(src/qt/locale/bitcoin_*.ts)
isEmpty(QMAKE_LRELEASE) {
win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe
else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
}
isEmpty(QM_DIR):QM_DIR = $$PWD/src/qt/locale
# automatically build translations, so they can be included in resource file
TSQM.name = lrelease ${QMAKE_FILE_IN}
TSQM.input = TRANSLATIONS
TSQM.output = $$QM_DIR/${QMAKE_FILE_BASE}.qm
TSQM.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
TSQM.CONFIG = no_link
QMAKE_EXTRA_COMPILERS += TSQM
# "Other files" to show in Qt Creator
OTHER_FILES += README.md \
doc/*.rst \
doc/*.txt \
src/qt/res/bitcoin-qt.rc \
src/test/*.cpp \
src/test/*.h \
src/qt/test/*.cpp \
src/qt/test/*.h
# platform specific defaults, if not overridden on command line
isEmpty(BOOST_LIB_SUFFIX) {
macx:BOOST_LIB_SUFFIX = -mt
win32:BOOST_LIB_SUFFIX = -mgw44-mt-s-1_50
}
isEmpty(BOOST_THREAD_LIB_SUFFIX) {
BOOST_THREAD_LIB_SUFFIX = $$BOOST_LIB_SUFFIX
}
isEmpty(BDB_LIB_PATH) {
macx:BDB_LIB_PATH = /opt/local/lib/db48
}
isEmpty(BDB_LIB_SUFFIX) {
macx:BDB_LIB_SUFFIX = -4.8
}
isEmpty(BDB_INCLUDE_PATH) {
macx:BDB_INCLUDE_PATH = /opt/local/include/db48
}
isEmpty(BOOST_LIB_PATH) {
macx:BOOST_LIB_PATH = /opt/local/lib
}
isEmpty(BOOST_INCLUDE_PATH) {
macx:BOOST_INCLUDE_PATH = /opt/local/include
}
win32:DEFINES += WIN32
win32:RC_FILE = src/qt/res/bitcoin-qt.rc
win32:!contains(MINGW_THREAD_BUGFIX, 0) {
# At least qmake's win32-g++-cross profile is missing the -lmingwthrd
# thread-safety flag. GCC has -mthreads to enable this, but it doesn't
# work with static linking. -lmingwthrd must come BEFORE -lmingw, so
# it is prepended to QMAKE_LIBS_QT_ENTRY.
# It can be turned off with MINGW_THREAD_BUGFIX=0, just in case it causes
# any problems on some untested qmake profile now or in the future.
DEFINES += _MT
QMAKE_LIBS_QT_ENTRY = -lmingwthrd $$QMAKE_LIBS_QT_ENTRY
}
!win32:!macx {
DEFINES += LINUX
LIBS += -lrt
# _FILE_OFFSET_BITS=64 lets 32-bit fopen transparently support large files.
DEFINES += _FILE_OFFSET_BITS=64
}
macx:HEADERS += src/qt/macdockiconhandler.h
macx:OBJECTIVE_SOURCES += src/qt/macdockiconhandler.mm
macx:LIBS += -framework Foundation -framework ApplicationServices -framework AppKit
macx:DEFINES += MAC_OSX MSG_NOSIGNAL=0
macx:ICON = src/qt/res/icons/bitcoin.icns
macx:QMAKE_CFLAGS_THREAD += -pthread
macx:QMAKE_LFLAGS_THREAD += -pthread
macx:QMAKE_CXXFLAGS_THREAD += -pthread
macx:QMAKE_INFO_PLIST = share/qt/Info.plist
# Set libraries and includes at end, to use platform-defined defaults if not overridden
INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH $$QRENCODE_INCLUDE_PATH
LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,)
LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX
# -lgdi32 has to happen after -lcrypto (see #681)
win32:LIBS += -lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32
LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX
win32:LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX
macx:LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX
contains(RELEASE, 1) {
!win32:!macx {
# Linux: turn dynamic linking back on for c/c++ runtime libraries
LIBS += -Wl,-Bdynamic
}
}
system($$QMAKE_LRELEASE -silent $$TRANSLATIONS)
As I have said the instructions that all of the wallets I'm trying to compile come with say the exact same thing.
Bitcoin-Qt: Qt4 GUI for Bitcoin
===============================
Build instructions
===================
Debian
-------
First, make sure that the required packages for Qt4 development of your
distribution are installed, these are
::
for Debian and Ubuntu <= 11.10 :
::
apt-get install qt4-qmake libqt4-dev build-essential libboost-dev libboost-system-dev \
libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev \
libssl-dev libdb4.8++-dev
for Ubuntu >= 12.04 (please read the 'Berkely DB version warning' below):
::
apt-get install qt4-qmake libqt4-dev build-essential libboost-dev libboost-system-dev \
libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev \
libssl-dev libdb++-dev libminiupnpc-dev
then execute the following:
::
qmake
make
Alternatively, install `Qt Creator`_ and open the `bitcoin-qt.pro` file.
An executable named `bitcoin-qt` will be built.
.. _`Qt Creator`: http://qt-project.org/downloads/
Mac OS X
--------
- Download and install the `Qt Mac OS X SDK`_. It is recommended to also install Apple's Xcode with UNIX tools.
- Download and install either `MacPorts`_ or `HomeBrew`_.
- Execute the following commands in a terminal to get the dependencies using MacPorts:
::
sudo port selfupdate
sudo port install boost db48 miniupnpc
- Execute the following commands in a terminal to get the dependencies using HomeBrew:
::
brew update
brew install boost miniupnpc openssl berkeley-db4
- If using HomeBrew, edit `bitcoin-qt.pro` to account for library location differences. There's a diff in `contrib/homebrew/bitcoin-qt-pro.patch` that shows what you need to change, or you can just patch by doing
patch -p1 < contrib/homebrew/bitcoin.qt.pro.patch
- Open the bitcoin-qt.pro file in Qt Creator and build as normal (cmd-B)
.. _`Qt Mac OS X SDK`: http://qt-project.org/downloads/
.. _`MacPorts`: http://www.macports.org/install.php
.. _`HomeBrew`: http://mxcl.github.io/homebrew/
Build configuration options
============================
UPnP port forwarding
---------------------
To use UPnP for port forwarding behind a NAT router (recommended, as more connections overall allow for a faster and more stable bitcoin experience), pass the following argument to qmake:
::
qmake "USE_UPNP=1"
(in **Qt Creator**, you can find the setting for additional qmake arguments under "Projects" -> "Build Settings" -> "Build Steps", then click "Details" next to **qmake**)
This requires miniupnpc for UPnP port mapping. It can be downloaded from
http://miniupnp.tuxfamily.org/files/. UPnP support is not compiled in by default.
Set USE_UPNP to a different value to control this:
+------------+--------------------------------------------------------------------------+
| USE_UPNP=- | no UPnP support, miniupnpc not required; |
+------------+--------------------------------------------------------------------------+
| USE_UPNP=0 | (the default) built with UPnP, support turned off by default at runtime; |
+------------+--------------------------------------------------------------------------+
| USE_UPNP=1 | build with UPnP support turned on by default at runtime. |
+------------+--------------------------------------------------------------------------+
Notification support for recent (k)ubuntu versions
---------------------------------------------------
To see desktop notifications on (k)ubuntu versions starting from 10.04, enable usage of the
FreeDesktop notification interface through DBUS using the following qmake option:
::
qmake "USE_DBUS=1"
Generation of QR codes
-----------------------
libqrencode may be used to generate QRCode images for payment requests.
It can be downloaded from http://fukuchi.org/works/qrencode/index.html.en, or installed via your package manager. Pass the USE_QRCODE
flag to qmake to control this:
+--------------+--------------------------------------------------------------------------+
| USE_QRCODE=0 | (the default) No QRCode support - libarcode not required |
+--------------+--------------------------------------------------------------------------+
| USE_QRCODE=1 | QRCode support enabled |
+--------------+--------------------------------------------------------------------------+
Berkely DB version warning
==========================
A warning for people using the *static binary* version of Bitcoin on a Linux/UNIX-ish system (tl;dr: **Berkely DB databases are not forward compatible**).
The static binary version of Bitcoin is linked against libdb4.8 (see also `this Debian issue`_).
Now the nasty thing is that databases from 5.X are not compatible with 4.X.
If the globally installed development package of Berkely DB installed on your system is 5.X, any source you
build yourself will be linked against that. The first time you run with a 5.X version the database will be upgraded,
and 4.X cannot open the new format. This means that you cannot go back to the old statically linked version without
significant hassle!
.. _`this Debian issue`: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=621425
Ubuntu 11.10 warning
====================
Ubuntu 11.10 has a package called 'qt-at-spi' installed by default. At the time of writing, having that package
installed causes bitcoin-qt to crash intermittently. The issue has been reported as `launchpad bug 857790`_, but
isn't yet fixed.
Until the bug is fixed, you can remove the qt-at-spi package to work around the problem, though this will presumably
disable screen reader functionality for Qt apps:
::
sudo apt-get remove qt-at-spi
.. _`launchpad bug 857790`: https://bugs.launchpad.net/ubuntu/+source/qt-at-spi/+bug/857790
But when I try and compile with QT Creator or through terminal I get:
home/kun7/CoinMining/zetacoin-0.8.3/src/qt/bitcoin.cpp:5: error: QApplication: No such file or directory
I have found that lots of people are adding 'QT += widgets' to their .ro files and it fixes it, but when I do that I get:
/home/kun7/CoinMining/zetacoin-0.8.3/src/qt/bitcoin.cpp:122: error: 'setCodecForTr' is not a member of 'QTextCodec'
/home/kun7/CoinMining/zetacoin-0.8.3/src/qt/bitcoin.cpp:123: error: 'setCodecForCStrings' is not a member of 'QTextCodec'
/home/kun7/CoinMining/zetacoin-0.8.3/src/qt/bitcoin.cpp:123: error: 'codecForTr' is not a member of 'QTextCodec'
What am I missing?

The issue has been fixed!!!
I was a moron.
I was trying to run
qmake
make
But my system has qmake version 5 installed and i installed verion 4 as per the dependencies. So instead, to get the program to compile correctly, i need to force the use of version 4...
qmake-qt4
make
Voiala!!!!!

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

Which module to install to fix "module QtQuick.Controls.Styles is not installed" error for Yocto?

I've successfully built a Yocto image for the RPi2 following this tutorial. I decided to expand the QML demo and try some of the Qt quick styles (import QtQuick.Controls.Styles 1.4).
Here is the bb file for the image
# Pulled from a mix of different images:
include recipes-core/images/rpi-basic-image.bb
# This image is a little more full featured, and includes wifi
# support, provided you have a raspberrypi3
inherit linux-raspberrypi-base
SUMMARY = "The minimal image that can run Qt5 applications"
LICENSE = "MIT"
# depend on bcm2835, which will bring in rpi-config
DEPENDS += "bcm2835-bootfiles"
MY_TOOLS = " \
qtbase \
qtbase-dev \
qtbase-mkspecs \
qtbase-plugins \
qtbase-tools \
"
MY_PKGS = " \
qt3d \
qt3d-dev \
qt3d-mkspecs \
qtcharts \
qtcharts-dev \
qtcharts-mkspecs \
qtconnectivity-dev \
qtconnectivity-mkspecs \
qtquickcontrols2 \
qtquickcontrols2-dev \
qtquickcontrols2-mkspecs \
qtdeclarative \
qtdeclarative-dev \
qtdeclarative-mkspecs \
qtgraphicaleffects \
qtgraphicaleffects-dev \
"
MY_FEATURES = " \
linux-firmware-bcm43430 \
bluez5 \
i2c-tools \
python-smbus \
bridge-utils \
hostapd \
dhcp-server \
iptables \
wpa-supplicant \
"
DISTRO_FEATURES_append += " bluez5 bluetooth wifi"
IMAGE_INSTALL_append = " \
${MY_TOOLS} \
${MY_PKGS} \
${MY_FEATURES} \
basicquick \
"
# Qt >5.7 doesn't ship with fonts, so these need to be added explicitely
IMAGE_INSTALL_append = "\
ttf-dejavu-sans \
ttf-dejavu-sans-mono \
ttf-dejavu-sans-condensed \
ttf-dejavu-serif \
ttf-dejavu-serif-condensed \
ttf-dejavu-common \
"
and the bb file for the demo itself
SUMMARY = "Simple Qt5 Quick application"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
# I want to make sure these get installed too.
DEPENDS += "qtbase qtdeclarative qtquickcontrols2"
SRCREV = "${AUTOREV}"
# GitLab own repo
SRC_URI[sha256sum] = "f2dcc13cda523e9aa9e8e1db6752b3dfaf4b531bfc9bb8e272eb3bfc5974738a"
SRC_URI = "git://git#gitlab.com:/some-repo.git;protocol=ssh"
S = "${WORKDIR}/git"
require recipes-qt/qt5/qt5.inc
do_install() {
install -d ${D}${bindir}
install -m 0755 BasicQuick ${D}${bindir}
}
Upon execution I got the error
QQmlApplicationEngine failed to load component
qrc:/main.qml:24 Type Page2 unavailable
qrc:/Page2.qml:4 module "QtQuick.Controls.Styles" is not installed
with Page2 being an item I have defined and used inside main.qml. The demo runs without any issues on my PC (custom built Qt 5.9.1) but fails on the RPi2 due to the missing submodule.
Frankly I've never use this submodule before (my custom built Qt 5.9.1 has everything enabled) and I'm not sure what I need include (if meta-qt5 even provides it) in order to be able to use it on the Yocto system.
The problem is the mismatch of versions of the Qt Quick Controls package.
You use version 1:
import QtQuick.Controls.Styles 1.4
but build version 2:
MY_PKGS = " \
...
qtquickcontrols2 \
...
What you need include in your image is qtquickcontrols.
You need to install qtquickcontrols-qmlplugins.
Just add to build/local.conf
PACKAGECONFIG_append_pn-qtbase = " accessibility"
PACKAGECONFIG_append_pn-qtquickcontrols = " accessibility"
IMAGE_INSTALL_append = " qtdeclarative-qmlplugins qtquickcontrols-qmlplugins"
Here is origin manual
https://importgeek.wordpress.com/2018/07/17/module-qtquick-controls-is-not-installed/

Applying patch to file in yocto recipe

I have a yocto recipe to compile a code from github. I modified some files and want to apply a patch to code fetched from github. Following is my recipe for building code.
SUMMARY = "Linux NFC stack for NCI based NXP NFC Controllers"
HOMEPAGE = "https://github.com/NXPNFCLinux/linux_libnfc-nci"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://src/include/linux_nfc_api.h;endline=17;md5=42fdb99b3ff2c12f594b22a774cb7308"
SECTION = "libs"
SRC_URI = "git://github.com/NXPNFCLinux/linux_libnfc-nci.git \
file:///home/pratyush/Desktop/custom_board/drivers/PN7150/linux_libnfc-nci/demoapp-main-patch1.patch"
SRCREV = "7cf539d3d9c0d682c8da5968fbf5615ae9993060"
PV = "2.1+git${SRCPV}"
EXTRA_OECONF =" --enable-pn7150"
S = "${WORKDIR}/git"
inherit autotools
FILES_${PN} += "${libdir}/libnfc_nci_linux-1.so"
FILES_SOLIBSDEV = "${libdir}/libnfc_nci_linux.so"
Following my patch to applied
--- /home/root/PN7150/linux_libnfc-nci/Makefile.am
+++ Makefile.am
## -1,7 +1,7 ##
lib_LTLIBRARIES = libnfc_nci_linux.la
-sbin_PROGRAMS = nfcDemoApp
-nfcDemoApp_DEPENDENCIES = libnfc_nci_linux.la
+sbin_PROGRAMS = readNfc
+readNfc_DEPENDENCIES = libnfc_nci_linux.la
LDFLAGS = -Bstatic
## -9,13 +9,13 ##
LDFLAGS += -L$(openssldir)/lib -lcrypto -lssl
endif
-nfcDemoApp_FLAGS = -I$(srcdir)/demoapp -I$(srcdir)/src/include
+readNfc_FLAGS = -I$(srcdir)/demoapp -I$(srcdir)/src/include
AM_CPPFLAGS = \
-I$(srcdir)/src/include \
$(INCLUDE_PARAMS) \
$(libnfc_nci_linux_la_FLAGS) \
- $(nfcDemoApp_FLAGS)
+ $(readNfc_FLAGS)
if LLCP1_3
AM_CPPFLAGS += \
## -177,7 +177,7 ##
src/service/linux_nfc_api.c \
src/service/linux_nfc_factory_api.c
-nfcDemoApp_SOURCES := \
+readNfc_SOURCES := \
demoapp/main.c \
demoapp/tools.c
## -231,6 +231,6 ##
libnfc_nci_linux_la_LDFLAGS +=-DPN551C2=3
libnfc_nci_linux_la_LDFLAGS += -shared -pthread -ldl -lrt -fPIC -release 1 -versionnfo 0:0:0
-nfcDemoApp_LDFLAGS = -pthread -ldl -lrt -lnfc_nci_linux
+readNfc_LDFLAGS = -pthread -ldl -lrt -lnfc_nci_linux
Thus I want to apply a patch from local to github fetched code. But whenever I try to bitbake apply patch I always get the following error:
can't find file to patch at input line 3
The problem is how you created your patch. The easiest way (if you're used to git) is to use git. Otherwise, diffing two complete source trees is a good and easy way.
One way to solve your issue would be to add ;striplevel=0 to the SRC_URI line. (A strip level of 1 is assumed by bitbake / OE).
Another way would be to modify your patch to start with:
--- a/Makefile.am
+++ b/Makefile.am
That should solve your problem.

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