I would like to use heob to check my app for memory leaks. This is what i tried: I opened the project "analogclock" from the examples collection in qtcreator. After that i have chosen "Analyze" and "Heob" from the drop down menu. After choosing the heob path and a click on the ok button, the application starts and a console window "heob32" is displayed. But now nothing happens. Just the word "kill" is displayed in the console window. I can´t see any output and if i close the analogclock app i get the message: "heob: cannot create target process". Can anyone help me further to get useful output from heob?
What OS are you using and what heob did you install?
You need to download and install heob separately from Creator. Creator just installs a link without heob itself. Have you done this? Are you really running on a 32-bit system (there is a heob64 in case you are using a modern OS).
Did you configure your heob installation in Qt Creator correctly?
Can you run heob from the commandline with reasonable behaviour?
Related
I downloaded C++ code from GitHub to tag images for training an object detector using Machine Learning.
Within Qt Creator 4.2.1 Based on Qt 5.8.0 (MSVC 2015, 32bit), I was able to compile and run the code. Unfortunately, I was not able to run the .exe outside of Qt Creator.
Initially, I received an error that
"The program can't start because libgcc_s_dw2-1.dll is missing".
Thanks to
QT The program can't start because libgcc_s_dw2-1.dll is missing, that was fixed easily by adding
"QMAKE_LFLAGS += -static"
to the .pro file. Now, when I run it I get
"The application was unable to start correctly (0xc000007b). Click OK to close the application."
I was able to reproduce the error using the simple "Hello World" default project that appears when you create a Qt Widget Application. This led me to believe something was wrong with my installation.
Based on the advice of this article: https://stackoverflow.com/questions/12099117/32-bit-qt-application-on-win-7-x64-wont-run-but-runs-fine-from-qt-creator, I used Dependency Walker to identify possible causes. I expected to see only a few items that I can follow up on. Instead, I received a list of close to 100 missing .dll files. All the files started with
"API-MS-WIN ###.DLL" or "EXT-MS ###.DLL"
where ### represent some additional text characters, for example;
"API-MS-WIN-SHCORE-STREAM-WINRT-L1-1-0.DLL"
I'm attaching a sample output.
Another suggestion was to copy over
libwinpthread-1.dll, libstdc++-6.dll, libgcc_s_dw2-1.dll.
That did not work either.
My next move was to simply get the latest version of QT and wish for the best. I installed Qt Creator 4.8.1 Based on At 5.12.0 (MSVC 2015, 32 bit). This time, I could not even get the code to run in the IDE. I received 1000+ error messages!
Based on advice from several pages, I added
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
to the .pro file and it still would not compile.
Also, I verified that the application is being built as a 32bit application. I'm running on a 64 bit Windows 10 system.
If anyone would like to take a crack at it to see if they can create a working .exe, here is the link: github.com/clavicule/BBTag
Qt provides a tool to copy the necessary dlls to the folder of your executable.
The tools is called windeployqt.exe and comes with your Qt installation. For me it is located at C:\Qt\5.9.1\msvc2015_64\bin\windeployqt.exe. You will have to look at your installation path and probably the msvc_32 folder to find it.
Then you go to the folder with your executable in it, oben a command prompt or powershell and execute path\to\windeployqt.exe yourProgram.exe and it will automatically copy the necessary dll files to this folder. Afterwards you can run your program without issues.
The official documentation for the tool can be found here.
Alternative 1: While developing you could use QtCreator which automatically adds the paths to the dlls when running your program - make sure to include them if you deploy your program!
Alternative 2: Add the path to the necessary dlls to your PATH variable. This isn't recommended either, since everyone who gets your program would have to do the same to run it.
I figured it out! My installation of Anaconda (a Python distribution popular for data science and machine learning) is the culprit.
From: #remy-lebeau
The application was unable to start correctly (0xc000007b)
The error:
"The application was unable to start correctly (0xc000007b) ..."
is a good indicator that the 32-bit app tried to load a 64-bit DLL. At first, this did not make sense since I verified many times that I was using the 32 bit version of Qt.
It turns out that the installation of the 64 bit version of Anaconda also contained many Qt5 dlls used for the PyQt5 package. Since the path to this folder came before the path to my c:\Qt...\bin folder, it was used in the build instead of the actual 32 bit version installed with Qt. This was not obvious because I was unaware of PyQt5 so I had no idea that it came with Anaconda. A simple reordering of the path entries using the System Environment Variables interface AND a system restart fixed the problem.
Silver lining: I now know C++ and designing GUIs w/ QT and PyQt5
Thanks #albertmand and #jwernerny
I have made an application in QtCreator
I use QML for the GUI, and I use QBS as the build system
I want to be able to deploy the application to windows (and maybe to Linux and MacOS, but right now, I'm only concerned with Windows)
I tried following the deployment tutorial for Qmake with a minimal example(using QBS to build the binary on windows, and with the MSVC2017 compiler, as of 2018-05-23 3:38 PM GMT-6 I've been trying to install MinGW with the Qt Maintenance tool for the last 6 hours, and it's still only at 5%, so I will try with MinGW once that finishes), but I have the following problem
using the Qt Quick Application - Swipe template, the release version with the MSVC2017 compiler, after using windeployqt.exe --release --qmldir ../src example.exe to get the dlls and other libraries
and trying to execute example.exe, I get a message saying
"Qml debugging is enabled. Only use this in a safe environment!"
in a cmd window, right before the actual application starts
and even if I try to disable that in the build step of the project, it doesn't get disabled
it still shows the cmd with the message, is there a way to completely make sure the build settings will work? am I missing a QtCreator configuration to make sure the settings I set actually do what they're intended? do I need to restart Qtcreator or Windows for them to work?
Update: still happens, even with MinGW
This is a bug that will be fixed in Creator 4.7. See https://bugreports.qt.io/browse/QTCREATORBUG-20377.
Greetings for the first time:
Usually I can work my way through problems like this but I think I need help for this one.
I have developed a small utility for myself to plot some data using Qt and Qwt under Mint. When I run the application from Qt Creator everything works fine. Once I added (export LD_LIBRARY_PATH="/usr/local/qwt-6.1.3/lib") to my .bashrc file, I can invoke the application from the terminal with “./PlotAccountsChange” and it woks. Also the ldd command shows all dependencies have been found.
The problem I am having is that the application can not be invoked from the Nemo file manager, or from the menu system if I add the link to the executable in the menu, or from a link to the executable placed on the desktop. In all of these cases I get no indication at all, just nothing happens. Any other application that I have created using Qt but that doesn’t use Qwt invokes without problems.
Thank you, regards,
B Kace
I have create a wxwidgets program(Pure C++) , the build is success and running is OK
But when I click the program in finder, a terminal windows is popup.
How to avoid the terminal window being popup?
PS: Similiar problem is also seen in Visual Studio, and can be fixed by changing subsystem from Console to Windows
Is there a similiar configuration in Xcode?
You must make a bundle for your application under OS X. If you use Xcode, this should already be the case. If you use makefiles/command line, look at how the minimal sample included in wxWidgets distribution does it.
I have seen the original question qt-creator-how-to-set-application-icon
but it did not help me because i am building an app in ubuntu and the Qt`s Documentation
is not clear for me..
Is there anynone, who has done it?
Whats the method?
Thanks in advance.
Linux does not have any standard for reading embedded resources, so there is no way to embed the icon in the application binary itself and have it display in the menu and launcher. You will have to install your icon in the appropriate pixmaps directory and a .desktop file in appropriate apps directory pointing to your application and respective icon.
The Qt documentation you quoted refers to icon theme specification, which describes where the files should be installed. Look for the Installing Application Icons towards the end for summary of what needs to be done.
You will have to install the files in the "install" target of your build system (qmake or cmake or what you use) and possibly create a Debian package on top of that. The Qt Creator is unlikely to help you with these.