Qt GUI application build settings in Qt Creator - c++

While I develop a small GUI application using Qt Creator (MinGW in Windows), the compilation is successful, and the binary is generated. But application is not ran, it gets crashed.
Below is my configuration setup:
Qt Version: 4.8.2
MinGW: compilerpath: C:\MinGW\bin\g++ debugger: C:\MinGW\bin\gdb
If I don't use Qt classes (QApplication, QWidget or QString), it works fine. I mean if I use std lib functions, it works fine.
Can any one suggest please?

What is your g++ version? You need to use g++-4.4 with Qt binaries downloaded from their site.

Related

Qt cannot load cocoa plugin

I'm trying to compile and run an application on a MacBook using Qt Creator. There are no issues compiling the project, but when I try and run it, it seems to be unable to load a plugin.
Could not load the Qt platform plugin "cocoa" in "" even though it was found.
The application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
This error occurs both when trying to run the application from Qt Creator or via Finder. It seems to only happen when I use the CMake build system (no issues when using QMake), but my existing project that I need to deploy on MacOS uses CMake.
My steps to reproduce are:
Install a completely clean MacOS (no user data)
Install Xcode 11
Install CMake 3.15
Install Qt 5.13.1 MacOS package
Open QtCreator->New Project->Qt Quick Application - Scroll
Set build system to CMake (important)
Compile and notice error
I am using:
Qt 5.13.1
macOS Catalina 10.15
Apple Clang 11
I recognize that for final user deployment I will need to use the macqtdeploy tool to copy the Qt libraries to the executable folder, but I should be able to run my app from QtCreator without doing this? Especially as it works fine when using QMake.
So it ended up being some kind of name resolution thing where Qt Creator couldn't decide whether to use the debug or release versions of the framework. Supplying DYLD_IMAGE_SUFFIX=_debug fixed this (add this to the environment section under Kits).

Deploying Qt application on Windows/Linux, developing on MacOS

I am trying to send my current program to a colleague. He's on Linux, I'm on MacOS. The result of my release build is an .app file. I would like to have a binary executable through ./binary. There's a Makefile in the folder, but it throws make: Nothing to be done for 'first'., so I guess I can't use that.
I am running Qt 5.4.1, Qt Creator 3.4.0. Compiling through GCC/CLANG.
Is there a way to do this?

QT adding compiler

I have QT 5.3.1 for Android (Windows), downloaded from http://qt-project.org/downloads with minGW 4.8.
Now I want to use MinGW 4.9 compiler.
To do so, I download mingw-w64 build [i686, posix, dwarf], and install it to separate folder.
Then, in QT creator, I add compiler in the "Build&Run" options.
Now when I compile something with -std=c++1y flag, in release mode - my program crashes at once (even window does not appear), and in debug mode I get :
During startup program exited with code 0xc0000139
What I do wrong?
I use Qt build from qtx64. It is built using MinGW 4.9 and has dwarf,seh,sjlj builds for x86/x64.
To use it you can create Qt Creator kit with it. You can use Qt Creator from qt-project.org but It should be configured like this:
Configuration images

c++ Qt Qwt build issue

I a Qt neophyte so I apologize in advance if this question is obvious...
I just downloaded and installed the latest version of Qt Creator 5 as well as Qwt (Qt Widgets for Technical Applications) on my Windows7 machine.
Qwt.pro does not build using QT Creator on my windows machine.
It all worked fine on my Ubuntu machine using Qt Creator 4.
Is there a compatibility issue with Qwt and the newest version of Qt??
Have you installed the MinGW version Qt? If not make sure you have installed Visual Studio, which contains the MSVC compiler. To get started use the MinGW version, the MSVC compiler is faster on Windows but more complicated to set up. For testing run qmake in your Qwt directory directly from the Qt console (start menu). Also make sure you can build a simple hello world project with Qt Creator first.

The program has unexpectedly finished - QT creator

I am trying to use QT creator to develop GUI/Console applications using QT framework. I am using windows XP. I installed QT 4.8.3 and mingw. Both are installed without any error.
And then I installed QT creator.
QT Version: Qt 4.8.2 in PATH (4.8.2)
Mingw(manual)
Compiler path: C:\MinGW\bin\g++.exe
Debugger path: C:\MinGW\bin\gdb.exe
mkspec: win32-g++
EnvironmentVariables:
QTDIR, PATH, MinGW,
PATH includes 4.8.2\bin; mingw\bin
INCLUDE : 4.8.2\include
When i try to develop an application using qt creator, it has been built properly and binary is also generated without any error.
But when I try to run the application, It is crashed saying that
The program has unexpectedly finished.
C:\Qt\4.8.2\examples\widgets\analogclock-build-desktop-Qt_4_8_2_in_PATH__4_8_2__Debug\debug\analogclock.exe exited with code -1073741819
This crash came for example application provided by QT library( it is analog clock)
Please try to help me in this, Do I need to set any variables or other
Thank alot.
I had exactly the same problem and solved it yesterday.
If the output of g++ --version doesn't say something like 4.4, this is binary incompatibility. You'll have to get MinGW 4.4. It is included in QtSDK, or at least was.
Next, configure your QtCreator settings ("Build & Run > Toolchains").