Warning while building project using Qt 5.1 on OSX - qt

I am getting two warnings while trying to build Qt projects on Mac (using QtCreator).
warning: No .qmake.cache is present. This significantly slows down
qmake with this makespec. warning: Call 'cache()' in the top-level
project file to rectify this problem.
The warning instructs to call cache() in the top level project, but I don't find any documentation on how I should do that.
I see some bugs logged on qt
https://bugreports.qt.io/browse/QTBUG-31340
https://bugreports.qt.io/browse/QTBUG-30586
I know this is just a warning, but I am interested in fixing it. Is there any workaround to fix it?

The solution is to call cache() in your main .pro file.
Then run qmake (from the QtCreator build menu) and rebuild the project.
The warning should be gone.
Example .pro:
cache()
QT += ...
//the rest of the .pro file

Related

A header paths error in Qt when building with Cmake

It's not answer, but yet another question! While compiling a cmake generated ninja build for Qt, we get such an error - #include "../../../../../../../e:/github/Qt/qtbase/src/corelib/animation/qparallelanimationgroup.h", or something like this. Of course, the file won't be found.
Where, I gess, is the fault - in cmake or in a cmake script for Qt building?
It happens from version into version, when you build QT a 'disk-away' far from its sources location.
As it is generated automatically, it should be found and corrected in Qt source files!

Cannot find c:\Users\qt\work\install\lib\Qt5Widgetsd.lib when compiling QtWebEngine examples

I downloaded Qt5.6 VS2013 32bit and try to run the official example of QtWebEngine.
I just followed the instruction but
When linking it gives out an error of
LNK1104 file not found c:\Users\qt\work\install\lib\Qt5Widgetsd.lib.
However, I have no idea of where this path c:\Users\qt\work\install\lib\ comes from.
I did text search in all directories of example folder and no hits other than generated files(makefiles and pdbs).
I also checked system environment variables but no hits.
Furthermore, I checked Qt Creator'r Projects panel and its Build Environment and still no hits.
Did I miss something?
P.S. this error was given out by linking DemoBrowser example of QtWebEngineWidgets pro
The link is generated by qmake when it generates the build scrip from the qt project file (*.pro). It is based from the qmake application path that is generaly installed together with the libraries (check you qt kit setup to change it if needed: Jst browse to qmake.exe application).
Then try regenerate the build script. It should fix the issue.
You may also have issue with installation not being in debug mode; you are trying to use Qt5Widgetsd.lib library instead of the non-debug one Qt5Widgets.lib

Error in OpenCV configuration for Qt Creator

I followed these instructions in the configuration of OpenCV SDK for using it in Qt Creator IDE, but I couldn't conclude point 6.5, due to configuration errors in Cmake-GUI. I setup the configuration in CMake of the compilers gcc and g++ contained in Qt folder for MinGW32, and all looks Ok. But when Cmake-GUI starts the process of build configuration it ends up saying
"Error in configuration process, project files may be invalid".
It can't find the following:
QT_QMAKE_EXECUTABLE;
Qt5Concurrent_DIR;
QT5Core_DIR;
QT5Gui_DIR;
QT5Test_DIR;
QT5Widgets_DIR.
After this issue I tried to go on with following points of configuration tutorial, without reaching the final instruction of mingw32-make install. I'm using the following versions of softwares: Qt 5.3.0, OpenCV 2.4.9, CMake 2.8.12.2. My OS is Windows 7.
How can I recover the missing Qt files in CMake configuration?
Is there an alternative way for configuring OpenCV with Qt (like using precompiled build of OpenCV libraries)?
You just need to indicate CMake the correct paths to each one. Click oh the path to browse and set each one individually:
QT_QMAKE_EXECUTABLE;
For this one, you need to search inside the Qt installation folder for the /bin directory. On it, you' ll find the qmake.exe. In my case it was C:/Qt/5.3/winrt_x64/bin/qmake.exe
All the following ones are in the Qt's /lib/cmake directory. In my case: C:/Qt/5.3/winrt_x64/lib/cmake :
Qt5Concurrent_DIR;
C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Concurrent
QT5Core_DIR;
C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Core
QT5Gui_DIR;
C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Gui
QT5Test_DIR;
C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Test
QT5Widgets_DIR.
C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Widgets
Then click generate. It' ll show a new error and ask you for the QT5OpenGL_DIR. Just as before, show CMake the correct directory. In my case: C:/Qt/5.3/winrt_x64/lib/cmake/Qt5OpenGL. Finally, click Configure again, and then Generate, and now you're done creating the build files.
You have to specify the location of Qt manually by passing it as an argument for QT5Core_DIR. Qt5_DIR or CMAKE_PREFIX_PATH does also the trick.
Example
Given your Qt 5 is installed at /opt/selfcompiled/Qt5. When calling cmake, add the flag from above:
cmake -DQt5_DIR=/opt/selfcompiled/Qt5 <pathToSourceDir>
Once the Qt 5 directory is set and found by CMake, all the other variables related to Qt 5 should be found from there, too.

Cannot find -lQt5Guid and -lQt5Cored

I am currently trying to compile a Qt application that I downloaded from github on my windows machine. I did not have any trouble compiling this on Ubuntu so I was hoping someone could help shed some light on my problem.
I am using Qt-Creator to compile the program.
The exact error messages are:
:-1: error: cannot find -lQt5Guid
:-1: error: cannot find -lQt5Cored
collect2.exe:-1: error: error: ld returned 1 exit status
My first idea when reading those messages was that the windows PATH variable does not include the locations of the libraries. But when I checked, my PATH contained the following:
C:\Qt\Qt5.1.0\5.1.0\mingw48_32\bin;C:\Qt\Qt5.1.0\Tools\mingw48_32\bin;...
Which exists and contains what looks like the correct Dlls.
I am using MingGW rather than the visual studio compiler (although i have it available if needs be).
How can I fix this error and what could be causing it?
EDIT: When I run qmake there does not seem to be any problem. The errors come up when I try to build the project.
Cored is a fundimental part of Qt so it looks like the linker can't see any of the Qt libraries.
Did you install Qt 5.1.0 SDK?
A few things to check:
Do you have a line like this in your .pro file?:
QT += core
You mentioned "Projects section my path" are you talking about the windows PATH variable? these paths should also be in that. You can check with dos command:
echo %PATH%
If these paths are not there, for a test, add them in if this works then something has gone wrong with the local PATH setup (i.e. when running qt creator - if you are using qt creator?)
Finally just check that the debug version of the Qt5Cored.dll exists in that folder (C:\Qt\Qt5.1.0\5.1.0\mingw48_32\bin) because it looks like you are building a debug build (which is why your program is looking for 'd' post-fixed name Qt5Cored and not Qt5Core).

using external libraries in Qt/Symbian

To get Facebook integration in our Nokia Symbian application we intend to use this library:
http://gitorious.org/qfacebookconnect
It is not otherwise working completely correctly, but it's a good start.
I have my project (.pro and .cpp files, using Qt Creator), which works fine in the emulator. I included this libqfacebook in the project in this way (in the .pro file):
LIBS += -LC:\projects\Pristop\Nokia\facebook_lib\libqfacebook-build-simulator\debug -lqfacebookconnect
INCLUDEPATH += C:\projects\Pristop\Nokia\facebook_lib\qfacebookconnect\inc
It works fine in the emulator. I use Qt Creator for everything, also to build libqfacebook. But if I want to test the application on a real phone, so to prepare a .sis file, I get this error:
:: error: No rule to make target `\NokiaQtSDK\Symbian\SDK\epoc32\release\armv5\LIB\qfacebookconnect.dso', needed by `\NokiaQtSDK\Symbian\SDK\epoc32\release\gcce\udeb\DogajaItak.exe'. Stop.
So I need to get a .dso file based on the source code of the qfacebookconnect library. For the emulator .lib and .pdb were enough. Obviously the difference is that .dso is arm while .lib & .pdb are x86.
If I try to configure qfacebookconnect to build for the phone, I get this error:
Makefile:232: error: PKG file does not exist, 'sis' and 'installer_sis' target are only supported for executables or projects with DEPLOYMENT statement. Stop.
It is correct that I do not want a .sis, all I want is a .dso.
If I go to Projects->Build Settings for Symbian Device for qfacebookconnect and I remove the build step "create SIS package" for qfacebookconnect, there is no error anymore, but I still don't believe it built a .dso for me.
So the question is how to configure Qt Creator or the .pro file to build me a .dso, or how to include external libraries in my .sis in another way?
I needed to freeze the library..
I found all the information there:
https://code.google.com/p/qfacebookconnect/issues/detail?id=13

Resources