Qmake does not specify a valid qt - qt

After installing Qt SDK for Open Source C++ development on Mac OS by following the respective steps
Note for the binary package: If you have the binary package, simply
double-click on the Qt.mpkg and follow the instructions to install Qt.
Yes, that is all I have done to install Qt on MacOsX. Everything was going fine, until I run a sample application, of which compile output resulted in:
No valid Qt version set.
Set one in Preferences
Error while building project qtilk
When executing build step 'QMake'
Canceled build.
Then I tried to change the respective Qt version in Preferences and I hovered over the Path, I realized my mkspec isn't set:
Then I tried querying qmake by qmake -query:
QT_INSTALL_PREFIX:/
QT_INSTALL_DATA:/usr/local/Qt4.6
QT_INSTALL_DOCS:/Developer/Documentation/Qt
QT_INSTALL_HEADERS:/usr/include
QT_INSTALL_LIBS:/Library/Frameworks
QT_INSTALL_BINS:/Developer/Tools/Qt
QT_INSTALL_PLUGINS:/Developer/Applications/Qt/plugins
QT_INSTALL_TRANSLATIONS:/Developer/Applications/Qt/translations
QT_INSTALL_CONFIGURATION:/Library/Preferences/Qt
QT_INSTALL_EXAMPLES:/Developer/Examples/Qt/
QT_INSTALL_DEMOS:/Developer/Examples/Qt/Demos
**QMAKE_MKSPECS:/usr/local/Qt4.6/mkspecs**
QMAKE_VERSION:2.01a
QT_VERSION:4.6.2
QMAKE_MKSPECS seems to be set here??
Will setting my mkspec solve my building problem? I tried setting by typing export mkspec=macx-g++. Still, mkspec seems not to be set to anything. I am all ears waiting for your answers. Thanks in advance.

To set the correct spec, use:
qmake -spec max-g++

Related

Development on KDE platform

I'm interested in learning about kde environment. So I read the contribution page on wiki, git cloned the kompare repo and built it. But an attempt to execute the binary gave me an error saying Could not load our KompareNavigationPart. The console showed the following error about kservice:
> ./kompare
kf5.kxmlgui: cannot find .rc file "kompareui.rc" for component "kompare"
kf5.kservice.services: KMimeTypeTrader: couldn't find service type "Kompare/ViewPart"
Please ensure that the .desktop file for it is installed; then run kbuildsycoca5.
kf5.kxmlgui: cannot find .rc file "kompareui.rc" for component "kompare"
Aborting aboutToFinish handling.
I couldn't find anything about it in the readme or the project wiki. I've installed the kde-development-meta package on arch linux. Can anyone help me get started with development on kde platform?
Short answer: Use "cmake -DCMAKE_INSTALL_PREFIX=/usr" and "make install".
Long answer: It looks like you tried to run from the build directory, but the KDE plugin loader does not look there by default. You could adjust the various path variables to additionally point to your build directory. The variables are mentioned at https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source#Set_up_the_runtime_environment
You can also use "make install" to install to a run-time directory. If you did not change the defaults of cmake via -D option, this will be "/usr/local/", and in this case you also have to adjust the various path variables to include that directory, unless your distribution already configured this for you.

How to use add-on "QtFtp"?

I want to use FTP in my current project, but since Qt5 ftp isn't available (only as add-on).
I downloaded the sources from here: https://github.com/qt/qtftp
In Qt's forum, I found a instruction how to use it:
Open Console in the qtftp-folder
Generate the headers: cd qtftp, <QTDIR>/bin/syncqt.pl -version 5.2.0
Run qmake
Run make (mingw32-make)
Run make install (mingw32-make install)
Add QT += ftp in my .pro-file
Run qmake on my project
compile my project.
(https://forum.qt.io/topic/23904/qtftp-and-qthttp-compatibility-add-ons-for-qhttp-and-qftp-classes-in-qt-5)
So, I wanted to try these steps, but it fails on the first step, because the syncqt.pl cant be found, but I looked in the Qt-directory, and the file is there.
Anybody has an idea, how to fix/solve this? I am using Qt5.9.1
If you have downloaded the portable version of strawberry-perl like me, just extract .zip somewhere on your disk. After that, open the portableshell.bat (it should open a command prompt window)
After that, you can type in the code of step 2, and don't forget to add the -version argument.
Then you can continue with step 3, and everything should work without any problems.

OpenFlipper fails to compile, unable to find Qt

On its website OpenFlipper says it can be compiled in three steps as:
cd build
cmake ..
make # or, even better, make -j8
However I get an error saying Qt is unable to be found at the cmake step and that I should specify a QT5_INSTALL_PATH. However even if I do this OpenFlipper is still issuing the same complaint!
You are not supposed to specify where Qt is installed in the QT5_INSTALLED_DIR but prior to that as environment variable in your terminal:
# assuming Qt was installed in your home directory, as is default
export CMAKE_PREFIX_PATH=~/Qt5.7.0/5.7/gcc_64/
# note that you now have to call cmake etc from that process
Compiling and running it after that you might get errors telling you GL_ARB_vertex_buffer_object is not present, even if your glxinfo | grep ARB_vertex_buffer is telling you it is.* Clicking "Ignore" results in a crash. To mitigate this, you have to manually change (4,3) to (3,0) in
OpenFlipper/widgets/coreWidget/CoreWidget.cc
If you still experience errors, try deleting your cmake cache, this is accomplished by using cmake-gui (was in the package cmake-qt-gui for me) and hitting "Delete Cache"
(optional) remove the very annoying warning message you get at every start of OpenFlipper by removing the line concerning "renderers shipped" in
OpenFlipper/Core/Core.cc
*: My teaching assistant told me that there is a bug in Qt (<5.9) that forces OpenFlipper to use the OpenGL Compatibility Profile. Additionally Intel and AMD drivers hand back an OpenGL 3.0 Core Context when asked for an OpenGL 4.3 Compatibility Context (my TA described this behavior as a "bug", I'm not so sure about this), leading to a crash in Qt. So this should be resolved in Qt 5.9 (not out yet). This seems to affect also mainly integrated graphics, so one could try using a dedicated GPU.

Installing Qt SDK, cannot link to the C++ libraries

So I have installed the QtSDK on my Windows 7 64 bit machine. However, it seems like when I try to run a simple program like hello world such as:
#include <iostream>
int main(....) {
std::cout << "Hello World\n";
}
My program first gets the error:
CreateProcess: No Such file or directory.
So what I did was I went to this link here:
http://wiki.codeblocks.org/index.php?title=Installing_MinGW_with_Vista
And I first tried to add the directory to the
PATH: C:\MinGW\libexec\gcc\mingw32\MinGW-Version
(my directory is slightly different but follows same idea)
where MinGW-Version is the Version of MinGW you are using
So now that got rid of that error but now I get the error:
iostream: No such file or directory
So now I add the path where the iostream library is and that fixes that error but then I get all these other errors where it can't find other standard C++ libraries such as stddef.h or stdio.h etc. So it seems as if the C++ libraries cannot be linked to. I have tried various other things such as including C:\MinGW\bin in my path and have tried uninstalling and reinstalling Qt. Also I have checked that Qt is using the right gcc compiler by going to Tools->Options->Toolchains in Qt Creator.
It seems that the linking to C++ libraries is not correct for some reason. Could anyone help me or guide me as to why this may be happening and how to fix this?
I'm not sure why it's not working, so I'll just tell you how my environment is set up. I don't think you need to add any library paths to the system path. You should only need to add C:\MinGW\bin.
So get rid of everything except for that. Also, are you setting this through cmd or control panel? If doing it in the control panel, make sure you are putting it in the "Path" variable not "PATH" -> the former is in the lower box. I've had problems before using "PATH" in the upper box - not sure what the difference is to be honest.
The QtSDK installation usually install the mingw compiler for you in ...\QtSDK\mingw. The libraries and dlls in ...\QtSDK\Desktop\Qt\4.7.3\mingw were compiled with this compiler. The mingw compiler you installed to c:\MinGW may be a different version than that. If you want to use this compiler you would have to recompile the Qt libraries.
C++ librairies in Qt.
Go to this URL http://doc.qt.digia.com/qtcreator-2.4/creator-overview.html for how to.
It seems (I did not try it, yet) that other librairies can be easily linked to a Qt Project.
This could solve the problem.
Pythagooric

bld.inf not found error in carbide.c++ using qt

I am trying to build a Qt GUI Main Window project and get the following errors:
BLDMAKEERROR:Can't find "\Symbian....\BLD.INF
bldmake returned with exit value=1
In the last two days, I've re-installed above apps many times following all
installation guides; setting up the environment variables but nothing worked
out.
Kindly anyone help as I've been able to build even the Helloworld program.
Thanks in advance.
bld.inf gets generated by qmake from your .pro file. Have you run qmake on your project? In Carbide.C++ Qt perspective it's Project->Run qmake.
I got the same problem even w/o Qt and qmake. :( The problem is in the IDE: it generates wrong bld.inf! If you open folder "group", which contains bld.inf, you'll see the Icons_aif_scalable_dc.mk file, but in bld.inf it configured as
PRJ_MMPFILES
gnumakefile icons_scalable_dc.mk
And this is the source of the problem, so after changing icons_scalable_dc.mk on Icons_aif_scalable_dc.mk project will be built as it should.

Resources