Bind Qt with QtGStreamer - c++

I am trying to make a simple qt c++ VoIP application, when I searched I found the QtGStreamer Lib and wanted to make it work. I download the latest version 1.2 from here.When I went to the example folder and tried to compile the VoIP example I got this error:
Qt5GStreamer-1.0 development package not found
What I try is comment this line CONFIG += link_pkgconfig in .pro file and add the src folder that came with the folder of QtGstreamer to folder project. I also added this to .pro file INCLUDEPATH += $$PWD/src this the path of the Libs folder
Now I get an error that i need to add boost Lib so I add it by adding this to .pro file
INCLUDEPATH += C:/boost_1_61_0
LIBS += "-LC:/boost_1_61_0/stage/lib"
Now I get many errors that say (undefined reference to ..) 130 error. Not sure what to try.
the file comes with containing Readme file I download the dependency but the same error I think the problem that I don't link it correctly I'm still a beginner in 3rd party and link libs in c++,
my os is windows
Thanks in advance

Related

QT Creator: OpenCV dll lib can not be added ("File format not recognized")

I'm trying to get openCV 3.1.0 to work in QT Creator 4.4.1 using this tutorial from their official site.
Right now, I'm setting up my project file. The whole file looks identical to the on in the tutorial apart from the last couple of lines, as my openCV build is in another place and it's a different version This is what I got:
INCLUDEPATH += C:\opencv\opencv-3.1.0\build\include
LIBS += -LC:\opencv\opencv-3.1.0\build\x64\vc14\bin \
libopencv_world310d \
As far as I understand, the "world" module has been introduced to openCV to unify all the different modules into one.
However, when I try to run this, QT produces the following error:
C:\opencv\opencv-3.1.0\build\x64\vc14\bin\opencv_world310d.dll:-1: error: file not recognized: File format not recognized
What am I doing wrong? In the tutorial there's an alternative way to link the libraries which even explicitly states them as .dll files. Why is this a problem?
You need to link to the .lib contained in the lib folder:
LIBS += -LC:\opencv\opencv-3.1.0\build\x64\vc14\lib \
and put the .dll in the PATH, or the same folder of the .exe

How to link QCA to my Qt project?

I have successfully cloned git repository of QCA and built it using
cmake .
make
sudo make install
This created bin directory with some executables and I can confirm everything works as should by running
$ bin/qcatool-qt5 plugins
/usr/lib/x86_64-linux-gnu/qt5/plugins
/home/metheuser/qtcreator/qca/bin
Available Providers:
qca-gnupg
qca-logger
qca-ossl
This product includes cryptographic software written by Eric Young
(eay#cryptsoft.com)
qca-softstore
However when I specify in my Qt project:
QT += crypto
I get this error
Unknown module(s) in QT: crypto
I have no idea how to include the library now. I have tried adding this to my .pro file:
LIBS += -lqca
and
LIBS += -lqca2
Both resulting in error:
cannot find -lqca
What should I do? I followed the official README/INSTALL instructions.
you need to add the lib path to your .pro file. So, Instead of
LIBS += -lqca
you need
LIBS += -L$${PATH_QCA_LIB} -lqca

Installing libusb on windows for use with Qt

I'm trying to install libusb (not libusb-win32) on windows 7. I have to link it with Qt 5.0.1. Here are the problems I'm facing
In the INSTALL file in the extracted libusb folder, it tells me to cd to the current folder then run
./configure
make
makeinstall
But I got the error
'./configure' is not recognized as a valid command.
Googling this problem usually gives the solution as installing libusb-win32. However, I want to avoid that, as of now.
In the libusb library, there were a few MSVC projects, so I built them. That did generated some .lib files. So I proceeded to link them with my Qt project. It recognizes the libusb.h header file but does not link properly. Here is my .pro file
QT += core gui widgets
TARGET = Qt_libusb TEMPLATE = app
SOURCES += main.cpp\
qt_libusb.cpp
HEADERS += qt_libusb.h
FORMS += qt_libusb.ui
LIBS += -LC:\libusb-1.0.18\Win32\Debug\lib\libusb-1.0
INCLUDEPATH += C:/libusb-1.0.18/libusb DEPENDPATH += C:/libusb-1.0.18/libusb
My objective is to link the libusb library with Qt. Please tell me if I haven't 'installed' the library correctly or if I am linking it in a wrong way. thanks
Your project file does not reference the library. You only provide a path where libraries might be found, but there's no reference to the libusb library itself.
What you're missing is something like
LIBS += -llibusb
You also can't have multiple project file statements on the same line. The below is an error:
TARGET = Qt_libusb TEMPLATE = app
It should look like:
TARGET = Qt_libusb
TEMPLATE = app

Qt Creator program crash with use of taglib

I have many problems with Taglib, Qt and MSVC2012
First, I compiled zlib with the cmake-gui and MSVC2012
Then, I compiled taglib with the cmake-gui and MSVC2012
After that, I opened up the .sln file in Visual Studio 2012,
then I built taglib. I got a .dll, a .lib and a .exp file. Everything good.
Then I made the following folder-structure in my Program-Folder:
My Program name is "MyM"
./MyM/taglib with all the folders inside (ape, asf, toolkit etc.)
./MyM here I have my tag.dll, my tag.lib and the "config.h" and the "taglib_config.h".
Then, in the .pro file, I added the following lines:
win32: LIBS += -L$$PWD/ -ltag
INCLUDEPATH += $$PWD/taglib
DEPENDPATH += $$PWD/taglib
So, I built the program and it says
"tstring.h": No such file or directory
So I searched in Google for this error and I found out that I can add every folder to the INCLUDEPATH. So I did this
INCLUDEPATH += $$PWD/taglib/ape
INCLUDEPATH += $$PWD/taglib/asf
INCLUDEPATH += ...
...and so on
So, build again -> everything good!
Then I clicked the "Run"-Button and the program crashes. I don't know why and yeah. Please help me
Thank you for reading :)
Just resolved the same issue after struggling a little.
The taglib requires the zlib. Nothing is said about it in documentation except at the cmake stage. So if you didn't linked it here then it's quite hard to guess the cause.
Link the zlib in your .pro and it won't crash anymore.

Error compiling C++ program against GeoIP library

I'm trying to compile a simple program using the GeoIP2 lite API. I've compiled the GeoIP Lite program and it created the library files. The .la file is in /mydir/libmaxminddb-0.5.3/src
I modified my .pro file to include:
LIBS += /mydir/libmaxminddb-0.5.3 -lmaxminddb
but when I compile my project errors with "Cannot find -lmaxminddb"
Can someone tell me what's wrong? I've tried changing directories, adding a "lib" prefix to the maxminddb, and more, but I can't figure it out.
(I'm trying to link against libmaxminddb.a which is pointed to by libmaxminddb.la)
I believe in autoconf and friends the -l flags go in the LDFLAGS variabe, not LIBS.
I found elsewhere that with Qt Creator you can right click the project and add an external library. When I do so, I see the .pro file adds:
LIBS
INCLUDEPATH
DEPENDPATH
So that's what you need to add!
That should be LIBS += -L/mydir/libmaxminddb-0.5.3 -lmaxminddb. Note the extra -L in front of the directory name.