Qt Static Linking not working without msvcrt.dll - qt

Hello my problem is how to build qt application without need a msvcrt.dll
and builded a exe need msvcrt.dll how to fix? im trying build with /MT commandline argument but not working ineed make a full Standalone Qt application.
Thank you

The solution is to use ./configure -static -static-runtime for MSVC when building Qt. It will link the windows runtime libraries statically.
-static-runtime .... Statically link the C/C++ runtime library.
or you use MingW as your compiler. MingW will not have the typical windows runtime dependencies. There may be dependencies, but they are already available on every Windows system.
As far as I know -static-runtime is available somewhere from Qt 5.x

Related

Unknown module(s) in QT: declarative

Sorry, this may be a dumb question, but I'm totally new in QT, I just need to run a project and Log some data.
I installed Qt "qt-unified-windows-x86-2.0.3-2-online", open the project and then click on configure, and then I got this error:
Unknown module(s) in QT: declarative
which wont let me compile the code. Everything else looks fine.
From researching I get that I may lack some libraries, I'm using windows, How do I get the proper library in windows? which is the library I need?
I'm using "Qt Creator user the kit Desktop Qt 5.7.0 MinGW 32bit."
Thank you.
I'm downloading linux, a live version, to try to run the code in there
The error occurs when trying to build a project that depends on the deprecated QtDeclarative module on Qt version 5.6 and later, as the module was removed in version 5.6.
The source code for the module is still available you can compile it from source. Or you can install a Qt version below Qt 5.6 to build the project.
You probably don't have declarative library installed somehow, here it is recommended to use a command-line utility named windeployqt, something like
windeployqt -declarative

Qt Creator - setting up a kit with a cross-compiler

I'm attempting to use Qt creator to cross-compile a project, but have an issue matching the Qt version and my specified compiler toolchain.
I have created a Kit setting up a Device, selecting my toolchain as the compiler (GCC ARM Linux in this case), but I only have a locally installed system Qt (5.0.2 on Mint x86).
Qt Creator understandably tells me the compiler cannot produce code for the Qt version; all the guides I have found suggest using a Qt compiled for the target platform. This doesn't make sense though - it attempts to run qmake compiled for a different architecture and fails
How do I install or configure/compile a Qt version to work with the cross compiler? Maybe I can modify my existing one to understand this setup?
Thanks
This makes absolutely sense. The advice to use a Qt, which is compiled for your target platform is correct. But this does not mean that you use a Qt that was compiled natively on that target platform. You need to use a Qt, which was compiled with a special cross compiler on your host platform for your target platform. This way qmake and other build tools remain executable on your host, but create configurations for your target.
So, if you have a compiler, which can create ARM code, use it to build your Qt. Then you can create a kit in QtCreator out of this compiler/Qt pair.
Greenflow is right. I would like to add some information. I have cross compiled Qt 5.4.1 on Windows having an ARM Linux as target platform. You just need to configure the build properly. Here's what I did:
./configure -platform win32-g++ -xplatform linux-arm-gnueabihf-g++ .....
So Qt tools (qmake,moc,etc...) were built as Windows binaries and all the libraries were built as Linux binaries. Check for the available platforms in qtbase/mkspecs.

Qt Creator 4.8.4. windows 7 - 64bit installation

I have some difficulties with QT, which I need for school for some GUI applications.
I have recently done these steps:
1) mingw-get-inst-20120426.exefrom SourceForge installed to C:\MinGW\ with default settings.
2) Qt libraries 4.8.4 for Windows (minGW 4.4, 317 MB) from QT Project installed to C:\Qt\ with default settings. Here an error occurs:
!!!There is a problem with your MinQW instalation
!!!g++ not found in c:\MinGW\bin\
!!!Do you still want to continue? Yes
I checked c:\MinGW\bin\ there is no such file
3) Qt Creator 2.6.0 for Windows (51 MB)also from QT installed to C:\Qt\gtcreator-2.6.0 with default settings
4) Run the QT IDE
5) Open project or create new project. Another error occurs here
!!!No valid kits fond.
Qt Creator uses the invalid kit Desktop to parse the project.
6) Open Options->Build & Run->Kits (But I don't know how should I set Kits and where to find them).
7) Can you also help me, how to set Qt version
(Options->Buid&Run->Qt Version)? Where do I find qmake.exe?
I also didn't find how to create GUI Application. There is no such option in New File or Project...
Thanks for help.
That is quite tricky ;)
Precompiled Qt (MinGW) is only win32 (not win64).
Precompiled Qt is compiled with MinGW-g++ 4.4 and won't work with other.
You have to download this one:
http://get.qt.nokia.com/misc/MinGW-gcc440_1.zip
//// Edit: With this version of MinGW, gdb won't work (it's not python-enabled). Although QtSDK is depracted (and you won't find it on qt-project.org), I highly recommend downloading this online installer and, during the selection of components mark only MinGW. It will come with folder named "pythongdb".
http://www.developer.nokia.com/info/sw.nokia.com/id/da8df288-e615-443d-be5c-00c8a72435f8/Qt_SDK.html
(You may need to register. It's free.)
////
Add "Compiler" by g++.exe
Add "Qt Version" by qmake.exe.
Add "Kit" with Compiler and Qt Version configured above. You can try to change debugger from CDB to GDB.
When you installed mingw, did you select the C++ compiler? It is not selected by default but you need it. Re-run the wizard and select that.
The kit is not valid because the C++ compiler cannot be found: try to install it first. If you still cannot setup this read the manual: http://doc-snapshot.qt-project.org/qtcreator-2.6/creator-targets.html. It is very complete.
qmake.exe is in *qt_directory*/bin/qmake.exe.
Try this out:
http://sourceforge.net/projects/mingw-w64/ (Since the mingw-w64 project on sourceforge.net is moving to mingw-w64.org i suggest to use mingw-w64.org)
It works for me.

Integrating QWT 6.0.1 with Qt Creator/Designer 4.8.0

I've installed the Qt SDK version 4.8.0 (to C:\QtSDK) on a Windows 7 64-bit machine. I've also installed and successfully compiled QWT 6.0.1 with MSVC2010.
I can use QWT in C++ code by linking to the libraries; however when I try to use the plugin I get an error that I can't seem to find on the Googles.
My failed plugin error is:
The plugin 'C:/QtSDK/QtCreator/bin/designer/qwt_designer_plugin.dll' uses an incompatible Qt library. (4.8.0) [release]
My QWTbuild.pri has CONFIG += debug_and_release
I built the plugin by doing:
C:\QtSDK\QWT\qwt-6.0.1\designer > qmake designer.pro
C:\QtSDK\QWT\qwt-6.0.1\designer > nmake release
I then copied the .dll generated (qwt_designer_plugin.dll) in C:\QtSDK\QWT\qwt-6.0.1\designer\plugins\designer to my plugin path for QtCreator (C:\QtSDK\QtCreator\bin\designer)
I've also put the .dll and the .lib generated in the Qt plugins folder (C:\QtSDK\Desktop\Qt\4.8.0\msvc2010\plugins\designer).
I've also linked my libraries in the project file containing the form I'm trying to build.
I'm sure that there's something small I'm missing, but I can't seem to find it. What am I doing wrong here? Any help would be greatly appreciated.
Regards,
Alexis
The Qt plugins should use the same version of Qt or a lower version with the same major number as the application they are loaded in.
Since the Qt Creator currently included in the Qt SDK seems to use Qt 4.7.4, you should probably recompile Qwt for that version of Qt.

Cross-Compiling Qt Applications from Windows to Mac OS

Can anyone tell me how to build .app extension files through Qt Creator-SDK and MingW? GCC Compiler is also installed.
I have done is
qmake -spec macx-xcode project_name.pro
It created supporting files to create .app extension (when opened in Notepad).
Thank You.
I recommend CMake: it does what it says on the tin: cross-platform make. Integrates nicely with Qt (it's what KDE uses).

Resources