Where is the Qt binary file? - qt

I'm on Manjaro based on Arch Linux.
I searched everywhere, and I cannot seem to find that binary file.
Searched /usr/lib/qt, used find and which commands, etc.
The only might-be relevant thing I found is in /usr/lib/qt6/bin/, I found a binary file called "qt-cmake". But I'm pretty sure that's not what I'm looking for.
My final goal is to install the latest release version of Qt Creator on GitHub, and installation needs to know the paths of two binary files :
Qt
Llfw
Installation guide precisely says "These instructions assume that Ninja is installed and in the PATH, Qt Creator sources are located at /path/to/qtcreator_sources, Qt is installed in /path/to/Qt, and LLVM is installed in /path/to/llvm."

There is no "Qt binary file" per se. Qt is a framework, delivered as a (large) group of libraries and header files.
The Qt installer should provide you with everything you need. I'm not sure this link will work for you, but...
Qt Installer
As an aside, Qt Creator is an IDE for building and testing Qt-based applications. It isn't clear to me why you'd need the sources for that.

Related

Run Binary With Specific QT Version - Cannot mix incompatible Qt library

I'm trying to replicate an application that we currently have running on a physical Ubuntu server using an Ubuntu machine in Virtual Box. It is a QT application but on the server we are running it using pm2 from NPM. After installing QT, and installing drivers needed for the application i've tried to run it but keep coming across this error:
Cannot mix incompatible Qt library (version 0x50701) with this library (version 0x50905)
I've inherited the code from someone else and don't want to change the project to QT5.9.5, so i'm trying to run with 5.7.1, I've followed instructions on other questions in order to change the QT version to 5.7.1 but still get the same error when running it.
I followed the instructions here:
https://unix.stackexchange.com/questions/116254/how-do-i-change-which-version-of-qt-is-used-for-qmake
When checking the QT version using "qmake -v" in the console I get the following output:
QMake version 3.0 Using Qt version 5.7.1 in /home/sam/Qt5.7.1/5.7/gcc_64/lib
So although it looks to me like i'm using the desired version of Qt (5.7.1), i'm still getting the incompatible library issue, i'm very new to all of this so apologies if this is a stupid question. If anyone could tell me what to do in order to use the compatible library that'd be great, thanks.
I will try to explain this in steps!
Each complete set of Qt libraries is called a Qt "distribution". You can get Qt distributions from a variety of sources:
Installed from the package manager of your OS (.deb/.rpm).
From a downloaded zip file on http://qt.io
As a cloned repo from git
etc..
Some of the available Qt distributions will come pre-built, and some will need to be built from sources. In either case they will all have a qmake program that is specific to that particular Qt distribution. This program is responsible for building programs so that they link to the particular Qt distribution that the qmake is part of. qmake is also used when building with QtCreator.
If you have a binary built with one qmake and you try to run it on another computer, it might find the wrong Qt libraries during dynamic linking and spit out errors of "incompatible version of Qt".
There are many solutions to this problem;
Collect all the Qt libraries (Mine are in /home/myusername/Qt/5.version/gcc_64/lib/*.so) in the same folder as your program executable. This will make sure they are prefered to any other version of Qt that may be in your dynamic linker's path.
Uninstall the OS supplied Qt version(s). This may not be advisable especially if other programs use them.
Rebuilt your program from source using the correct qmake.

Compiling and linking library MSVC/MingW

I'm a big fan of StackOverflow because you always have answers for problems, and now is my chance to get advance of it Ö!
I'm trying to use a library which I got in the Internet, its OZCollide. Its suppossed to be crossplatform as it says in its website "Cross-platform, works on Windows, Linux and Macintosh, in fact any platform supporting VisualStudio 6/7 or gcc"
I got all the .h and .cpp, compile them with MinGW as objects (.o) and then link them all using ar. But the problem is when I include and use the library on my project (QT & MinGW) it throws "undefined reference".
I thought the problem could be that library examples only uses Visual Studio, so the library coulnd't be compiled for MinGW, but the website tells other story.
Thanks for your time!
EDIT: Okay I have managed to compile it and use it moving to another computer and compiling makefile. The only one difference is that Computer A had Cygwing and MinGW installed (with Cygwin set up in Windows path) and Computer B only had MinGW.
So I guess the problem was Makefile calling for g++ and Cygwin g++ got called instead of MinGW g++??
If I'm right, whats the difference between Cygwin and MinGW?
if you have experience with CMake, create your own CMakeLists file and import/link this libraries against your project. In this way, you can create projects for MinGW/MSVC/Linux/etc.
Here you'll find a good start with CMake http://www.cmake.org/cmake-tutorial/

Linking netcdf library with Qt

I have a prebuilt version of netcdf Library which I've downloaded from the Unidata website,
Now I am trying to link this Library to Qt 5, to use it in my Qt project. So I looked for some solutions in the internet and I found that I should add these lines to my Project.pro :
LIBS += -LC:/netcdf/lib -lnetcdf
INCLUDEPATH += C:/netcdf/include
But after runing the project, it doesn't work, so I rerun it with the debuger and it shows me this Message Box (titled "executable Failed") : During startup program exited with code 0xc0000135
Please help !
The pre-built libraries are built using Microsoft Visual Studio. As I recall, the C/C++ compiler the Qt SDK uses on Windows is a mingw-variant of gcc. I am not certain if the pre-built netcdf libraries are compatible with the mingw runtime, but it is usually not a good idea to mix C runtimes anyways.
I'm assuming you are using Qt Creator; if so, then it may be easier than you think to compile the netcdf-c libraries yourself. Because the netcdf-c project uses CMake, you will be able to open it as a project in Qt Creator.
Prerequisites
You will need the following:
cmake: http://cmake.org
netcdf-c source code: http://github.com/Unidata/netcdf-c/releases
NetCDF Dependencies
Note that you will need to install the following dependencies first, depending on the functionality you want from the netcdf library.
NetCDF4 support requires libhdf5 and libhdf5_hl, both provided by the hdf5 package available from http://www.hdfgroup.org.
DAP support requires libcurl. Google should be able to help you find this.
If you do not need these capabilities, you'll be fine with a straight netcdf-classic install.
Opening netcdf-c as a project in Qt Creator
Launch Qt Creator
Go to file->open project
Navigate to the netcdf-c source directory and open the CMakeLists.txt file.
This will load the netcdf source as a new project in Qt Creator. At this point it should be pretty straight forward to compile netcdf and install it somewhere on your system to use with your project.
Incorrect Assumption
If my assumption that you are using Qt Creator is wrong, this is all still possible from the command line; it will be, however, a little more involved.

How to run a Qt application on a system where Qt is not installed?

I have made an application using QtWebKit, Qt4. I have the binary generated in Fedora 16. Now, I want to run that application on another PC (running some other Fedora version), where Qt is not installed. How can I package my Qt application so that it can run on a platform where Qt is not installed? Is there any command line utility as well as QtCreator utility to do so. I have tried "deploy all" command, but it didn't have any affect.
Create an Installer with the Qt Installer Framework and just supply all needed shared libraries (Win/OSX) or compile statically. Under Linux there is always the problem between system-wide libraries or bundled libraries. The documentation https://qt-project.org/doc/qt-5.0/qtdoc/deployment.html should give you a good start
Obviously, you need to have access to the qt libraries, which are exactly the same version that you used to compile your application.
There are two options :
link qt libraries statically
create a RPM package (see this how)
Also check Deploying Qt Applications.
Since you're deploying using rpm, to systems where Qt 4 rpms are available, you don't need to do anything besides simply adding a dependency on the qt to your rpm's specfile. The user installing your package using yum localinstall will get the Qt dependencies automatically installed. That's the correct way of doing it - it will keep your package size small.
Of course you need a separate rpm build for every fedora/centos major version out there, but that's almost always a requirement.
If your package needs newer Qt version than the one provided by the platform packages, you can still make a specific version dependency (say qt >= 4.7.0) and have a readme that indicates that newer packages can be obtained from a 3rd party repository (epel etc.)
For deployment under Linux I've used Bitrock Installer Tool.
The main thing before deploying is to check your dependencies. You can do that by using command:
ldd appName | grep libQt
After that you'll see list of dependencies. You'll have to set environment variable LD_LIBRARY_PATH to let linker know where're your libraries. To do that:
export LD_LIBRARY_PATH=.
. means current directory
And after that:
./appName $*
After that you'll be able to use your executable with Bitrock Installer Tool.

Qt 4.8.3 installation on Windows 7 & QtWebkit problems

I just updated my Qt to 4.8.3, because the program built from older version is not compatible to the new framework.
So I have to upgrade.
This process was frustrating and time consuming. So many problems came out.
I download Qt from this url:
http://qt-project.org/downloads
At beginning, I installed the MinGW one (I'm not a fan of MSVC).
I tried the newest ( I think it's 4.6) version of MinGW and order version (4.4).
However, after I installed MinGW and tried to install Qt 4.8.3, during the process, the following message shows up:
There is a problem with your MinGW installation:
The installer could not find a valid C:\MinGW\include\w32api.h (Only versions with W32API 3.13 are supported)
Do you still want to continue? (Your installation may not work)
The 4.6 version does have this w32api.h file, I don't know what's going on. And I have trouble finding MinGW 4.4 with this head file.
I decide to ignore this warning and continue to install Qt and Qt creator. After that,
I opened my current project, configure it (why the configuration become so complex...), I tried to build it.
Then the following message shows up because some external lib I used requires Exception Handling:
exception handling disabled, use -fexceptions to enable
And I don't know how to enable the it.
I tried to add -fexceptions flag in QMAKE_CXXFLAGS but it doesn't work.
By the way, I tried the VC version of Qt too, but I used the MinGW before and the VC compiler is quite different, if I use VC version, it will take a lot of time to make it compilable by VC compiler.
Does anyone know how to install Qt 4.8.3 on Windows? my project works fine before, now I just want to compile it successfully.......
These are not the only problem.
I updated the Qt on Mac machine too, it is easier to have the compiler work since it's unix base.
However, I used QtWebkit lib in my project and obviously, they changed this lib and it's not compatible to order version.
I can compile my project on Mac, however, every time I run it, following massage shows up and the program stopped.
dyld: Symbol not found: _OBJC_CLASS_$_CALayerHost Referenced from:
/Library/Frameworks/QtWebKit.framework/Versions/4/QtWebKit Expected
in:
/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
The program has unexpectedly finished.
Does any one know how to solve this QtWebKit problem? I'll really appreciate.
I remembered that when Qt is under nokia, it's so easy to install and use, the Qt SDK is perfect.
I really hate the change made after it was bought by digia.........
I found solutions of my first two problems:
for the first problem, as I described, download the MinGW provided by Nokia Qt
ftp.qt.nokia.com/misc/MinGW-gcc440_1.zip [ftp.qt.nokia.com]
Tried several versions of MinGW 4.4, I think this is the only one works.
About the second problem, add following configure in the project file:
CONFIG += exceptions
Now the QWebKit problem is only one unsolved.
Is it all relevant that your include directory for MinGW has two "i's" in it or was that a typographic error when posted on SO? See:
The installer could not find a valid C:\MinGW\iinclude\w32api.h

Resources