Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Working Code no longer works after moving to Win 7
I was previously using Qt on a computer that was running xp and created a simple C++ program. I have now replaced my old computer and updated to windows 7 and now I can not get Qt to run the program. It says it builds, but when the program runs it just finishes without doing anything. The only libraries and headers I've used are simple C++ libraries. Has anyone experienced this issue or know what could be the issue? Also I've already reinstalled Qt to see if there was just an issue with installation.
Thanks in advance for any assistance.
lgeyer last edited by
If you would provide any code it would be easier for us to help you.
cincirin last edited by
Are you using console application with reading some data from stdin ? If so, make sure you check "Run in terminal" from Project properties. If it is not, I have not encountered such a problem. But as @Lukas said, would be nice if you could write some code that cause the problem.
andre last edited by
How did you install the application on your new box? Did you take care to make sure the actual Qt libraries are installed in the expected way?
Andre I'm not sure I just ran the online installer, so do you suggest using the offline installer or what do you suggest exactly.
Cinirin I'm not using stdin, so its not having issues waiting on user input all my inputs are from a .txt.
Though I am using getline().
Here are the headers I'm using. The senior design one is included in the same file area so it shouldn't be an issue.
using namespace std;
The other odd thing I didn't mention was that at first it worked occasionally, like maybe every third time I tried to build and run it would work. But now I've got nothing.
Luckas can you be specific with what sorts of code you would like to see. The code is rather lengthy and I have no idea where it is failing. Tried to put some cout's to see if it would run to a point and what not, but it just ends with code -1073741819.
Ok, so I got it to run properly by commenting out large section of my code and building and running it. Then I would progressively remove commented sections without error and got to the end and it ran perfectly. The only code I added was "std::cout<<Inputs;" Which doesn't change anything, but I think it was more due to the comment run comment run, but even when that works it won't run from that same build again. I have to go through that entire process again.
Anyone got an idea? Is Win 7 or an antivirus blocking it from running or something?
How should we know without a single line of code?
From what I've heard, using Win 7 for both development and deployment usually works without any problems.
The problem doesn't seem to be Qt related.
Are you sure you have all libraries?
Are you sure all your libraries are compiled with the same compiler and settings (you must not mix Visual Studio versions, eg. VS2008 and VS2010)?
I'm not using visual studio. Just Qt and c++ libraries, which are with Qt correct? Also I am happy to add code, but not sure what to list because it does not give me an error at a line or runs up to a point. It just works or doesn't. If there is anything in particular you would like to see code wise I'd be happy to, but like I said before it's lengthy and last time I added code asking for help I got told off and that this forum wasn't the place to ask for that kind of help. Plus, the code executed fine when I was developing on Xp, but when I switched to Win 7 it will run 10% of the time.
Went through the debug run mode and it said there was a segmentation fault in signal SIGSEGV. I still have no idea how to fix this.
andre last edited by
SIGSEGV is the segmentation fault.
So how do I go about fixing it? It does not show the error in a piece of code I have written its in something that gets stepped into.
So what toolchain (compiler) do you use instead of visual studio? Do you use any external libraries in your project? Did you recompile everything on the Win7 box or did you just copy your binaries over?
I'm just trying to run from the sdk defaults, so MinGw. I think the issue might be I need to get the 64 bit version of Mingw. I'm going to try that and see if that works. Other than changing out Mingw for the 64 bit, I should be able to run c++ code from just downloading the sdk right? I've looked at the installation instructions, but it seems like they pertain to just if I was building from source or binary.
I rebuilt it, copy and pasted the code from the old files because I wasn't sure how much system specific data was included in the files.
The problem doesn't come up when I run it on a 32 bit virtual machine, so I am assuming the issue is the 32 bit MinGw. Thanks for the help and suggestions.
If you use a 64 bit MinGW you must make sure that everything else is in 64 bit too. This means, for example, that you need 64 bit versions of the Qt libs. As far as I know prebuilt 64 bit binaries of Qt for Windows are not available. This means that you need to compile the Qt libs manually, which is an easy task.