QT is failing to build ui_mainwindow.h, error 135 (-1073741515) - c++

My QT5.1.1 project used to build with qt creator but when I came into work today it no longer worked. To my knowledge, nothing has changed since the last time I was on. A co-worker needed to use my workstation earlier this week and says that he did not change anything.
The error shows up as:
[ui_mainwindow.h] Error -1073741515
I did a Google search and tried a few things.
This page said to try a clean build and run qMake then rebuild. This did not work even after trying multiple times.
This page led to the suggestion of adding QT += widgets to the .pro file (although I did not believe this would work I tried anyways)
I also tried closing the project and re-opening it. I deleted the build directory and that didn't work either.
EDIT:
I added error code 135 because according to this answer on stack overflow the two are related. I have not encountered or seen this error code come up. I have downloaded the dependency walker but I am not sure how to use it.
After a clean start up I get the following pop up when opening a project.
Image of error pop up

It turns out that a coworker accidentally moved a bunch of DLLs out of my MinGW bin directory. I had to move them back.

Related

Cannot run Qt C++ release build. 'The procedure entry point could not be located'

I am trying to deploy my Qt application and have run into a fatal error. The program works fine in the Qt editor, I can build and run it. After building my project in release mode and using windeployqt.exe to get the correct .dll's in the folder, I am treated to this error message. I get one for 5 different Qt .dll's. I found a way to remove this error by using the .dll's from Qt tools instead of the ones found in the compiler's bin directory. But, I am left with a remaining error like this. Unlike the previous errors', there is no dll being cited, only my program's directory.
I've tried this with 2 compilers by now. That which is provided by Qt, and my own installation. Both you can tell, have failed.
I had a similar problem few years ago when I was just learning QT. What I tried which did worked is that to move the .exe generated file to the location from where you copy paste the dlls and it worked like charm. You are getting the wrong dlls copied (perhaps). Try searching for correct ones on google!!

Debugging fails with QtCreator on OSX

I have OSX Yosemite 10.10.5, QtCreator 4.1.0, Qt 5.7.0 and Xcode 7.2.1.
If I write any native C++ program in QtCreator (console, gui - anything) I am unable to debug that program from QtCreator. Breakpoints get ignored, the program executes without pause and runs to completion no matter what I try.
I have tried the Xcode's LLDb, system GDB and Homebrew GDB as debuggers. the versions of GDB fail to start. Homebrew GDB has been codesigned.
This all used to (a few year back) just work beautifully and I am at a loss as to what might have changed.
Curiously, if I generate an exception inside the program - like accessing through a null pointer, the debugger shows me where this happens in just the way I would expect so, presumably, the debugger is running but simply treating me with complete disdain.
I know there are many versions of this question but none seem to address the problem adequately or offer workable solutions, or they apply to much older versions of the products.
Any suggestions?
This version of qtCreator (4.1.0) saw the return of the warning about having the build directory at the same level as the project directory. In Windows, this is done automatically. My mac installation does not get it right. (I may have messed a while back - cannot remember).
So - if the build directory is inside the project directory, debugging fails. Move the build directory up to the same level as the project directory and everything seems to work fine.
You can set the default build directory in the preferences/Build & Run dialogue. The path should start with ../
You will need to think about the folder structure before setting up the project unless you want build folders appearing in awkward places. So, a project folder structure like this is OK:
But one like this is not:
If this was already obvious to you, great. I have been messing with this for ages.
Many thanks to those who replied and anyone else who took the time to read the question. What helped e find it was the suggestion by #AlexanderVX that his setup was the same as mine but his worked. The only bit of my setup he could not see in the screenshots was the start of the build path. So that was the clue.

VS2015: Error List doesn't get cleared on new build

There are more than one C++ projects in a solution. Lets compile A, which will fail, and will have errors reported in Error List view. Now compile B (assume A is dependent on B), which will succeed. But, the errors rendered by compiling A doesn't go away.
Anyone encountered such issue? How to enable clearing the error-list view on each build (the way it is working for years). The Output window, however is clean on each new build.
Do you have 'Build Only' or 'Build + Intellisense' selected in the combo box? Many of my errors like this actually come from Intellisense (and tend to be bogus).
I currently have a similar problem with VS2015. I have a solution with c++ and c# wpf projects. Clean checkout, full build, no errors in Output but hundreds of errors appear in Error List. It reminds me of problems with earlier versions of VS back than the only fix was to close all open files but this time this is not helping either. In my case deleting the .suo file helped. See this for reference VS freaks out.
(edit) I read that Xamarin could cause the problem but uninstalling it and also uninstalling all the other addons delivered with VS2015 did not fix the problem. After a clean checkout and full build I got all the errors again.
On Visual Studio 2019, simply closing and restarting the application got rid of the warnings.

Xcode 7 beta 2 continuously crashing

I am developing a C++ project with Xcode.
My Xcode keeps crashing out of nowhere. It does so often that it is nearly impossible to work at all. I have been using Xcode 6 until now. Since it kept crashing, I just thought I would format everything. I did a clean install of Yosemite and then downloaded Xcode 7 beta 2 from the official Apple Developer page. I installed it on my clean system, then pulled my repo and tried to work. Still the same problem.
Here is the log of the crash:
http://pastebin.com/t4gMWa95
I have looked around SO and many answers suggested that this could be related to source control. However, I tried to disable source control from my settings and still it crashes as often as before.
Anyone can give me an idea on what is going on? This is frustrating...!
Hmm the crash is in clang::DiagnosticRenderer::emitDiagnostic which presumably is redering errors and warnings. Could there be something odd about your warnings? Or something that is echoed in warnings classnames, scource file names, paths to source files? Does it happen when there is so little code as to have no or few diagnostics? But first - make a new XCode project and add your source to that, see if the new one works better.
Go to Users>[UserName]>Library>Preferences
Search for "xcode" inside the "Preferences" folder
Move all the resulting files (I had 6 files when I searched) to Desktop
Restart your Mac
Now open Xcode and see if its crashing
These steps solved my problem. Hope this helps...

How to configure qt creator to show C++ code rather than disassembler?

Yesterday I had done a lot of things like updating GCC, Clang and reinstalling Qt Creator.Today when debugging my code step by step, the debugger was showing the disassembley rather than the C++ code I wrote. Pressing F10 or F11, the debugger was moving into assembly code not the .cpp nor .h files I wrote. F11 can only go into the library files but never into the files I wrote.
The arrow appeared in disassembler:
Rather than in main.cpp:
How can I configure Qt Creator such that the debugging arrow tracks each line in the C++ code?
For others who also had this problem but none of the solutions above worked (like me), I found out that the issue for me was simply happening because my project was inside of a directory with special characters (/home/fabio/criação/project) the criação folder seems to have caused the problem. After I changed to /home/fabio/Desktop/project it stop happening.
I ran into a very similar problem debugging code built with the clang toolset in qtcreator, and this answer fixed me up:
gdb doesn't find source files compiled by clang++
You can quickly check if that solution will work for you by navigating to the root of your solution in a shell window and then invoking qtcreator from there...set a break point in main() and try debugging - if it stops and shows source in main.cpp, it's quite likely this is the problem.
If that does work for you, there are probably several better ways to implement the permanent solution suggested by https://stackoverflow.com/users/1632219/rene, but the method that worked for me was to modify my qmake mkspec file for the clang toolset. On my system, it lives in /usr/local/Trolltech/Qt-4.8.5/mkspecs/common/clang.conf, so all I had to do was put a clang invoker script with 'clang++ "$#"' in ~/bin/clang-compile and then set QMAKE_CXX in the mkspec to clang-compile. With that change, when the clang toolset is selected, qmake builds make files that use clang-compile instead of clang++ and then debugging works everywhere.
At last, I found that it was Clang that had caused this problem. After changed the kit back to using gcc, it just worked fine. But not sure whether it's Clang's fault or that the script Qt produced for compiling has any problem. Anyway just put the answer here in case anyone else who might encounter the same situation.
Goto "Help->About Plugins" and check the "ClangCodeModel" and restart QT.
There is a bug in version Qt 5.6.1 (MSVC 2013, 32 bit) QT Creator4.0.3.
In debug mode put your breakpoint. Then hit the step into(F11) it will start debugging now. To go to your code hit the step-over(F10) until you come to the code page.
I have searched about this problem but nothing worked. Some solution, i didn't get.
This is very annoying issue.
Maybe it will work if you clean, qmake and rebuild.I solved this problem by using this method.