Qt iOS build does not find headers with path - c++

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.

Related

z.lib problems while porting qt creator projet to windows

I am trying to port a Qt5.9 project from Mac to Windows 10.
I was able to compile the project easily in a ubuntu installation.
While trying to build it for windows, i had problems with finding zlib include headers with
#include<zlib.h>
That i corrected after following answers here on Stack to
#include<QtZlib/zlib.h>
Now i have problems in LINK phase, it can not open the file z.lib
Problem is i downloaded zlib packages, builds, source code and could not find a z.lib. Only different named libs. Searching in google i could only find people with the same problem, z.lib is not one of the libs included in zlib installation.
This is my project file:
TEMPLATE = app
QT += qml quick widgets websockets
CONFIG += c++11
SOURCES += \
main.cpp \
api.cpp \
app.cpp
HEADERS += \
api.hpp \
app.hpp
RESOURCES += qml.qrc
LIBS += -lz
I tried putting all possible dll and lib files in the project folder. None of them is named z.lib though.
The symbols for zlib are already part of the qt libraries. As long as you do not try to link the zlib explicitly it should work. At least it does work for me.
add to your project file:
!win32 {
LIBS += -lz
}
I managed to solve my problem updating my Qt installation to use MinGw 5.3 32bit. I was using VisualStudio 2015 as the compiler before.
Only changing the compiler to MinGw (g++) 5.3 made everything work with the same pro file i posted in the original question. Thanks everybody who tried to help!

Update translation file using Boost library Qt 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.

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

Crosscompiling my Linux QT Project with MXE fails. Library not found

I have a QT5 Project on Linux using taglib. It compiles fine inside QtCreator and runs flawless under Linux.
Now I want to Crosscompile the code using MXE. I've downloaded and "installed" MXE according the docs. I did a "make" for making all libraries crosscompiled. I also set my PATH as described in the docs.
the qmake run makes no errors, but when i "make" the project, the compiler complains:
./tagprocessortaglib.h:12:21: fatal error: fileref.h: No such file or directory
#include <fileref.h>
^
compilation terminated.
fileref.h is one of the library headers used by taglib, its furthermore the first of 3 includes of that lib.
In my .pro file, this two lines were added by QtCreator as i included the library for linux:
unix: CONFIG += link_pkgconfig
unix: PKGCONFIG += taglib
Are there any configurations to do for the library that I've missed? Any help is welcome! Thanks in advance!
Solved the issue:
I applied the Solution posted here: Compiling QT project for win32 target on Linux PC with larmadillo
and added the path to the library, this works for the MXR compiler run, but i have to remove it before native compiler runs.

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).