I'm trying to compile my Qt based application using static linking. So after few days of struggling I have found this article about compiling Qt libraries as static environment.
Everything was OK until I reached problem with SSL support. So I have figured out that in this script (referenced from mentioned article) is configuration which uses -no-openssl parameter. But the build is failing when I try to use different option (-openssl or -openssl-linked).
I suppose I have to compile OpenSSL itself. Is it possible to do that just using MinGW bundled with Qt Creator ?
If not, how can I then link my static Qt environment with compiled OpenSSL in order to successfully build my Qt project through Qt Creator ?
Related
I am building a Qt application using Windows and MinGW64. I need to use Boost Stacktrace to generate stack traces like the Linux build of the application already does.
The corresponding switch BOOST_STACKTRACE_USE_BACKTRACE (as described in https://www.boost.org/doc/libs/1_65_1/doc/html/stacktrace/configuration_and_build.html) is set and everything works fine on Linux.
However on Windows the libbacktrace library is missing. The above boost page contains two links to the sources of libbacktrace but I couldn't find a prebuilt binary for Windows/MinGW nor could I find any build instructions or usage documentation for my environment.
How can I use BOOST_STACKTRACE_USE_BACKTRACE with Windows/MinGW64?
I solved this problem (and some more issues) by switching to MSYS2 UCRT. MSYS2 provides a precompiled libbacktrace package.
I just installed QT Creator with QT under Win10 to build an already existing project. (Under Ubuntu everything went fine running the Make file). I'm not an expert for QT therefore I'm not able to find out how to resolve the error:
C:\Qt\5.14.2\mingw73_64\include/QtCore/qfloat16.h:102:54: internal compiler error: in make_rtl_for_nonlocal_decl, at cp/decl.c:6590
Q_CORE_EXPORT static const quint32 mantissatable[];
My gcc version is 8.3.0 (x86_64-posix-seh, Built by strawberryperl.com project). Is there something missing or broken in the installation?
On windows, you generally need to have a Qt which was built with the same (or compatible, but that can be hard to verify) compiler and relevant build options, as what you are using to build your application.
I doubt you will find a pre-built Qt SDK for that version of gcc, so if you want to use it, you should build Qt from sources. It can be a bit tedious on Windows, there are a fewf prerequisites you have to get etc. I recommend you use the Qt online installer to install a MinGW version of Qt SDK, and matching version of MinGW (also offered by the Qt installer.
I just found out from qmake.stash, that the included script for creating the make file always referenced a false path for the gcc compiler. I therefore build i manually with the QT Creator and it worked as expected. So I guess the fault was due to different paths for gcc in the environmental variables.
Here is the bug, there is a link to the patch: https://github.com/msys2/MINGW-packages/issues/5006
Also you can just downgrade to mingw gcc 8.2.0
I am trying to use MQTT Poho C/C++ Client on Windows using Eclipse CDT and MinGW.
On Windows 10 I have installed Eclipse Neon and MinGW latest version with POSIX Thread Support.
Issue with MQTT Paho C++:
I have download the MQTT Paho Client C++ Source and also dependent C Library + headers
I have created a Eclipse CDT MinGW project and trying to build the sample application using C++ Paho
I am not able to build the code as I am getting compilation error for "std::mutex" 'mutex' is not a member of 'std', I tried to resolve it by googling but with no luck
As per one of the solutions I have also uninstalled MinGW which I have previously installed with pthread Win32 support and installed it again with pthread POSIX support.
I am also not able to find Paho C++ Pre-built libraries
Issue with MQTT Paho C Pre-built libraries:
I have download the Paho Pre-built C Library + headers for Windows
The zip file has .lib .dll .h and some samples
Again I have created a test project in Eclipse and included headers and libraries
Also configured the library path
It compiles correctly but linker hits the error and not able to find functions defined in .dll/.lib files
I checked rechecked everything but not sure about the issue
Do I need to use the DLL files provided with the library? I have not used them. I have tried to copy them in the Path and also in the same location as .lib but of no use
Also did google on how to use .dll with Eclipse CDT MinGW but no luck. :(
Let me know if anyone has tried to use Eclipse Paho C/C++ Source/Library With Windows Eclipse CDT MinGW.
Any possible solution to these issues will help.
I am having a difficult time trying to find a way to link the Qt library to my Eclipse project.
The Qt SDK package 4.8.1
with
Eclipse CDT Juno
Is there a way to link Qt libraries to eclipse?
UPDATE: It appears that the Eclipse plugin is no longer officially supported but that it's still available via download. The link below references their ftp site.
Nokia provides Eclipse-Qt integration. That said, it's unnecessary as it's always possible to use an Eclipse project that's using custom build commands. You could simply create a makefile project making certain to run qmake at the appropriate times.
To start, it might be as simple as:
Create a file or two
qmake -project # create your project file
qmake # generate your makefile
# tell eclipse to build the project
If the above, you'd only need to re-run qmake when adding new files and doing other things that affect the qt project file.
#enobayram
Yes it does.
The Qt integration pack is 32bit and therefore all depencies like Eclipse / Java / Qt must be also 32bit.
How to deploy Qt+Boost Application on Mac OS X or Windows platform.
I use Qt Creator + Qt 4.6 + MacOS 10.6
How to compile my application into release to run it on another computer w/o installed Qt libraries?
I ship Windows apps built with Qt and I use the Dependency Walker tool to first determine which Qt and MinGW DLLs are required. For Qt 4.6 apps you'll need to always ship the mingwm10.dll and libgcc_s_dw2-1.dll files found in your Qt bin folder (default location of this will be C:\Qt\2009.05\qt\bin).
Depending on which Qt modules you use will determine which Qt DLLs are shipped - you'll always need to ship QtCore4.dll. If you use networking then you'll need QtNetwork4.dll and so on - Dependency Walker will show you.
Note that you should only ship Qt files found in C:\Qt\2009.05\qt\bin and NOT those in C:\Qt\2009.05\bin - the latter folder contains MSVC built Qt DLLs used by Qt Creator and other tools and, assuming you're building using MinGW, these will not work with your app.)
I install these files in the application folder, which isn't ideal if you have multiple products that use Qt. If you are using the same version of Qt for all your projects then you could install the Qt files into a special folder that is then added to the user's PATH. YMMV and this is a big topic in itself.
For Qt, refer to the docs on deployment (Windows, Mac). Keep in mind that Qt is quite big - if you decide to link statically consider building a version of Qt that only contains the modules you need.
Most boost libraries are header only and thus need no deployment. For those that are not (thread, ...) refer to the respective documentation on building and deploy them like any other library.