Update translation file using Boost library Qt C++ - c++

I am using the Boost library in my C++ project.
I am including it in the PRO file like this:
win32: INCLUDEPATH += C:/boost_1_60_0
win32: LIBS += "-LC:/boost_1_60_0/stage/lib/"
But, when I run the following command on the terminal (cmd) to update my translation file:
lupdate MyProject.pro
It searchs for files in the Boost library path to update.
Is this normal? What can I do to not search in the Boost library path?
Now, I am commenting the Boost include lines when I need to run the lupdate command, but I don't want to do it every time I need to update my translation file.
Qt 5.3.2
Boost 1.6.0

There is a workaround in the bug report (QTBUG-27936), involving the TR_EXCLUDE option in the .pro project. It is used to tell lupdate to exclude certain files. I tested with Qt 5.6 and 5.8 and it worked as expected. Here there is the extract of my .pro file:
INCLUDEPATH += /Users/user/libs/boost
TR_EXCLUDE += /Users/user/libs/boost/*
PREVIOUS ANSWER
This is the previous answer, which I couldn't confirm and it happens to be wrong. I'm letting it here so it's kept documented. There is a workaround in the bug report (QTBUG-27936), which is to include all Boost libraries in the precompiled header, since lupdate doesn't look at it.

Related

Bind Qt with QtGStreamer

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

Qt iOS build does not find headers with path

I am building a working application (Mac and Linux) for iOS emulator in Qt 5.4 but when compiling the sources, compiler shows issues about header files not found. These files definitely are where they should be and the same code/pro builds without issues for desktop versions.
For example, in my code I have included:
#include <sndfile.h>
and in my .pro file I have:
LIBS += -L/usr/local/lib/ -lsndfile.1
INCLUDEPATH += /usr/local/include/
and the header file for libsndfile is definitely in /usr/local/include
I have tried adding this to .pro file
INCLUDEPATH+= $PWD
But no use, still all headers that are not directly in the same folder
as the .pro file cannot be found when compiling... What am I missing?
Is there some different way to define paths to iOS build sources?
I am able to build Qt iOS tutorial projects and run them on the emulator.
Perhaps your Makefile is outdated.
Run qmake again, after changing something in .pro file.

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.

How do I link to Qwt libraries on Ubuntu?

I have installed the Qwt library on Ubuntu 10.04. The Qwt plotting widgets have appeared in QtCreator but when I try to use any of them I get the error:
"qwt_plot.h" no such file or directory.
Can anyone help?
Edit:
I've solved this by implementing Begemoth's answer as follows:
Open the project file (.pro)
Add the following lines to the bottom of the file:
INCLUDEPATH += /usr/include/qwt-qt4
LIBS += -l qwt-qt4
Ubutu like Debian provides several versions of qwt (for qt4 and qt3), so include files for qwt reside in /usr/include/qwt-qt3 or /usr/include/qwt-qt4 directory, you need to add this directory to the list of the include search path, e.g. with -I gcc flag.
PS: I assume that you have installed the development package for qwt (libqwt5-qt4-dev).