Xerces Library and Qt - qt

I'm trying to setup xerces so that I can use it in Qt Creator for Windows.
Does Qt support windows/linux binaries or do I have to compile it using mingw as a target? How one goes about compiling those libraries in Windows?

No, you can't use libraries compiled for Linux under Windows. You'll have to either build it yourself or use existing Windows binary distribution. How that works in detail depends on the third-party library you want to use. The basic options are, in case you have to build it yourself: build it with MSVC under Windows, with mingw under Windows, or cross-compile it with mingw from e.g. Linux. MSVC tends to be less hassle under Windows, but mingw might just work as well.
Important: mingw and MSVC are ABI-incompatible when it comes to C++ libraries. You can't use e.g. a MSVC-built xerces in your mingw-Qt project, or a mingw-Xerces in an MSVC project. That only affects C++ libraries, not pure C ones.

Related

Self-contained toolchain for Qt for x86 Linux/Windows

I am setting up a Qt project which will be cross-copiled for a given display (running on ARM/Linux). The display will come with a self-contained cross-build toolchain which comprises Qt libraries with a specific Qt version (probably 5.15).
Now I would like to use a specific "static" toolchain incl. Qt libraries to also generate x86-builds of this Qt project (for testing, simulation; building/running on Linux and maybe also on Windows).
I'd avoid using the GCC and Qt development files introduced by the Linux package manager (e.g. apt), because the are not tied to a specific Qt version, i.e. upgrading the OS would always come with the risk to introduce build problems or break compatibility completely.
Are there good-practice approaches to achieve this?
So far I see three options:
Use a docker image
Possible problems:
Finding a image with the correct Qt version
building the Qt application would then work, but to execute it, the compatible Qt LGPL shared libs need to be available to the Qt application binary
Use a x86 -> x86 "standalone" toolchain
Find some standalone x86-toolchain analog to those (x86 -> x86), but additionaly...
it would either have to come with the Qt development files in the correct version
or we would have to build the Qt sources with this toolchain, and then extend the toolchain with the Qt built artifacts
Would be the preferred solution (and currently seems to be the most feasible of the approaches I can think of).
Virtual machine
Possible problems:
Finding a OS version with the correct Qt version
Select a OS version that contains the correct Qt version via package manager.
Not very elegant.
Qt online installer
only provides a limited choice of Qt versions (as of today: 5.15.2, 6.2.4, 6.3.2, 6.4.0) which is probably subject to change in the future

Qt5 Issues: error: shell32.lib: No such file or directory

I'm trying to learn how to use Qt for dev and have to say it's been a pain from the start.
I installed Qt Creator 5.4 version. Then followed this http://qt-project.org/wiki/Qt_for_beginners_Hello_World.
It defaulted to MSVS so I manually added MinGw. It has a red sign next to it saying that MinGW cannot compile code for the QT version.
I just want to use Qt5 and need an appropriate compiler for it. I'm used to using MinGW in Eclipse for C++ dev.
Your installation seems to be incomplete or inconsistent.
To work with Qt you actually need two things: One is a compiler toolchain (called the "kit" in Qt Creator), the other is the compiled Qt library, which is what is visible in settings under "Qt versions". Both need to fit together for Qt to work.
In case you want to use Qt with Visual Studio, you should select the precompiled Qt version corresponding to your (previously installed) VS version during install when you use the online installer. Or use the offline installer for your VS version. After install, everything finds together itself.
Or you want to use MinGW. Do yourself a favor and use the MinGW version which is installed by the Qt installer, which is different to the one from MinGW.org (it is the 32 bit version of the MinGW-w64 project, which is more up to date than the one from MinGW.org, and has some other subtleties). It is selectable in the installer under "tools". Additionally select the Qt version precompiled with MinGW. After install, select the MinGW Kit for your new project, and everything again will work from scratch. Again, you can use either the offline installer including MinGW-precompiled Qt or the online-installer which has all versions of precompiled selectable to perform that installation.

Qt SDK download for MingW

I´m looking for Qt SDK for windows that uses MingW as the compiler. Unfortunately, on the official download sites, I can only find the one that uses MSVC. Or just the library instead of the whole SDK.
Can anybody tell me where I can find the version I am looking for, or explain what I should do if I download QT library, QT creator and MingW seperately?
Here you can find pre-release builds using MinGW 4.7.
http://releases.qt-project.org/digia/5.0.1/latest/
They work well with the MinGW builds distributed here:
http://sourceforge.net/projects/mingwbuilds/
The Qt builds come with Qt Creator, so you can install it and should be good to go after setting up your kits.
You can find binaries here:
http://qt-project.org/forums/viewthread/23002/
But then you ought to reconfigure installation manual or you may use this utility.
Some guy from Digia promised MinGW builds by the end of January, so you can wait instead.

Qt3 on Windows?

I need to port one of my old program to Windows. The current version uses Qt 3 on Linux.
I'd like to see it within few days only to do some tests.
Instead of porting my code on Qt 4 (no time now), is it possible to recompile on Windows with Qt 3? Do I also need minGW? Which problems may I have doing this porting?
I can't find Qt 3 for windows, can someone give me a link? or I can use the same qt source I use on Linux?
Yes, you can !
Download the qt-win-3.3.x-8 project on Sourceforge.
QT4 still has back-compatible QT3 classes, prefixed with Q3* (see http://qt-project.org/doc/qt-4.8/qt3support.html)
You should be able to compile & run you QT3 app on QT4 via those classes with minimal adaptations.
Qt-3.2 for Windows was also distributed in a CD bundled with the book "C++ GUI programming with Qt3" at no additional cost with a license for non-commercial use.
ISBN: 978-0131240728
The supported compilers were MSVC and Borland. MingW is not mentioned.

How to force Qt Creator to use MinGW instead of Visual Studio

We're trying to compile a project with MinGW on the machine that has both MinGW (with Qt) and Visual Studio installed. Unfortunately, Qt creator prefers MSVS by default, and doesn't see it's very own MinGW (screenshot). Sadly, this results in a lot of obscure errors, because application was written and debugged with MinGW. Is there way to make Qt Creator to use MinGW without killing MSVS?
While installing, choose custom type of installation. Selected libraries for needed compilers in QtSDK->Development Tools->Desktop Qt->Qt-. Screenshot:
Have you made sure your Qt sdk is installed with its MinGW? You can use the Qt maintainance app to make sure its MinGW engine is installed.
Where are those libraries from? Did you compile the SDK yourself? Or did you downloded the libraries?
Try to see what is in the mkspecs directory. There should be a link named 'default'. That links to the specification which is being used. I suppose it is pointing to win32-msvc2008. You can change that but if it is pointing to that specification it means that the Qt libraries have been compiled with that specification (unless it was changed afterwards), which means you cannot use those with MinGW. You should compile the libraries with the correct specification or download the correct package (MinGW version).

Resources