Starting again from scratch
-
After many experiments with combinations of 4.7,, 5.1, mingw, vs2012, and assorted add-ons and updates, I finally reached the conclusion that the examples were never going to compile consistently, and so there would be little I could learn on the Qt system I had. So I uninstalled everything. I left the mingw and the VS 2012 I put into Win 7 64it thinkpad I have, and I removed everything else. I am now starting again by downloading Qt 5.1 vs2012 (again).
My goal is to be able to mess around with mobile phone apps and widgets that work cross platform, and learn a bit more about programming in the process.
The new install installed, but there is no link to a compiler. The options in Tools--Options-Build and Run--Compilers include miniGW, GCC, Clang, and "Custom" I had been hoping to find Visual Studio 2012. I need to find out what Clang is.
-
Hi trailnerror,
The first thing you should probably do is to select your "kits". A "Kit" is a combination of a compiler and a Qt version. Not all combinations do work since for each compiler, the corresponding Qt libraries need to be there. So, if you downloaded Qt for VS2012, you'll need to "connect" that Qt version with VS2012 compiler.If you download multiple Qt versions (or if you compile Qt yourself), you'll get more combination options.
You'll find the "Kits" in the same dialog where the "Compilers" are.
Btw: Clang is a relatively new free compiler suite. The website is "here":http://clang.llvm.org/. I would suggest to disregard this option at the moment. Clang has "its edges" still. However, if you work on a Mac this might be your best choice, as this is the official Mac compiler.
-
bq. if you work on a Mac this might be your best choice, as this is the official Mac compiler.
If you work on mac, make sure you know how to deploy QtQuick2 apps
before you use it, I found no document and no information how to deploy
QtQuick2 apps on mac os x, now I am considering to rewrite the apps
by the good old QWidgets or even switch back to Qt4. -
What issues were you facing with the examples?
Qt 4.7 is very old; I don't recommend it for new projects. Stick to Qt 5.1.
There are 2 kinds of packages for Windows: Those that use OpenGL (they're labelled as such in the Downloads page), and those that use ANGLE. To use the OpenGL packages, your graphics card must support OpenGL 2.0 or higher.
Qt Creator should auto-detect your copy of MSVC if it is still installed properly. Are you able to launch MSVC?
One thing about MinGW: Qt 4.7 uses MinGW 4.4, while Qt 5.1 uses MinGW 4.8. The two versions of MinGW are incompatible; make sure you're using the correct one. I suggest completely uninstalling MinGW and MSYS from your system, and installing this package: "Qt 5.1.0 for Windows 32-bit MinGW 4.8, OpenGL, 666 MB":http://download.qt-project.org/official_releases/qt/5.1/5.1.0/qt-windows-opensource-5.1.0-mingw48_opengl-x86-offline.exe -- it comes bundled with the correct version of MinGW (but your graphics card must support OpenGL 2.0 or higher)
[quote author="trailnerror" date="1373822309"]My goal is to be able to mess around with mobile phone apps and widgets that work cross platform, and learn a bit more about programming in the process.[/quote]Then you'll need to download and install the Android packages too (iOS packages need to be built manually, and no other mobile platforms are supported yet)
-
OK. This info will probably help. Since I need a kit for VS, and I can probably get it to link up. It will be simpler perhaps to download 5,1 with mingw4.8 (deleting my existing mingw. It would be nice to compile, and there is a very goo step-by-step how to, but even that; assumes more existing knowledge than I have, so it is unrealistic to attempt it.
Thanks so much for the pointers.
Update... First try at download didnt make it, the VS2012 kit did, though, so progress. Starting second try as overnight download.
Since I now have the MS SDK for VS2012 installed, I tried out the QT for VS2012 that I have not deleted. I will need to go through settings and get the Kit selected in the options. It does not autodetect. That will take a little reading uo, and it is a low priority
Second try. Almost did rc1 instead. But now I am once again trying to get Qt 5.1.0 for Windows 32-bit (MinGW 4.8, OpenGL, 666 MB)
-
[quote author="trailnerror" date="1373902525"]... so it is unrealistic to attempt it. [/quote]
Please keep your spirit up and keep on trying. I am very confident that, in the end, it will also work on your Windows 7 64bit computer. I work daily with just that setup.
As JKSH pointed out, it should autodetect your compilers. You should probably check whether Visual Studio is able to run by itself.
However, if it does not detect the compiler, these are the steps to create a Kit manually:
Open Qt Creator, select Menu Tools --> Options... to bring up the Options dialog
on the left side, click on Build & Run, this shows the "Kit construction area".
Set up the compiler(s):
select the tab Compilers. This shows a cascaded list with two main entries: Auto-detected and Manual. If you click on one of these entries, the settings of this entry will be shown below. The Auto-detected entries can not be changed. If you see your compiler not listed there, you can create it manually:
click on Add and select either GCC or MinGW
Select the compiler path (click on Browse). This should be the path to the g++.exe from your MinGW installation ( for example: C:\MinGW\bin\g++.exe. Or MinGW 4.8 from the Qt install: C:\Qt\Qt5.1.0\Tools\mingw48_32\bin\g++.exe )
give a sensible name to your compiler setting like MinGW 4.8 (x86 32bit) this makes it_ a lot _easier to work with different compilers later.
leave the other fields open or at the defaults.
Set up Qt Version:
select the tab Qt Versions, a similar list as with the compilers appears. Your version should be auto-detected. However manually creating is simple:
click on Add..., this will bring up a File selection dialog. Browse to the qmake.exe file in your Qt installation. (something like: C:\Qt\Qt5.1.0\5.1.0\msvc2012\bin\qmake.exe)
give a sensible name for the Qt Version, as above.
Creating the "Kit":
click on the tab Kits. A list as in the steps above appears.
click on Add, an Unnamed entry is created.
for the Compiler: select one of your compilers you created just before
for the Qt Version: select one of your versions you created just before
give a sensible name for the Kit, as above.
mark one of the Kits as default by clicking on Make Default
This is it. This should bring you into a position to compile the examples. You can just drag and drop any of the *.pro files into Qt Creator. I advise to first make a copy of the examples you want to compile. (You may want to revert to the "original" later).
-
As of my last update, I was getting an exception fault. Today I went home and tried once again to build example 1, the simple text editor. It built.
The calculator example, however, gave me this result
"Starting C:\Qt\Qt5.1.0minigw\5.1.0\mingw48_32\examples\quick\demos\build-calqlatr-Desktop_Qt_5_1_0_MinGW_32bit-Debug\debug\calqlatr.exe...
QML debugging is enabled. Only use this in a safe environment.
The program has unexpectedly finished.
C:\Qt\Qt5.1.0minigw\5.1.0\mingw48_32\examples\quick\demos\build-calqlatr-Desktop_Qt_5_1_0_MinGW_32bit-Debug\debug\calqlatr.exe exited with code -1073741819i GOOGLED AND IT TOOK ME TO THIS THREAD,
http://qt-project.org/forums/viewthread/26203
I checked for multiple mingws
I had deleted the old one before downloading 5.1
I am going to hold off on exploring dependency walker til I have implemented the excellent instructions I got from willl
-
OK. I have gone through willl's instructions, and learned how to select a compiler and a Qt and make a kit. Having tried that before without instructions, I can say I did a lot better having them.
Unfortunately, I am still getting the builds exiting with "exited with code -1073741819" and I am back to trying to figure out which dll is missing or something... The text editor, however, worked, so I can proceed on the assumption that the installation is no longer fundamentally fubar. In other words, it will work sometimes, so a lot must be in right.
-
The error code you are getting (-1073741819) is not the same as described in forum post "26023":http://qt-project.org/forums/viewthread/26203. If you convert the number to hex it renders 0xC0000005 which is the Windows error code for "Access Violation" . (described "here":http://stackoverflow.com/questions/901424/qt-programname-exe-exited-with-code-1073741819-how-can-i-fix-this and "here":http://www.qtcentre.org/threads/34339-program-crashing-randomly-code-1073741819 ). This is IMHO not directly pointing to missing DLL's. This could be a DLL mismatch perhaps. The Qt libraries absolutely need to be built with the same compiler version that your program is built with.
To fix the issue with multiple MinGW's, you also need to check your environment variables, especially the full content of %PATH%. You should normally not have paths to a MinGW installation there. Or, if you really need (if you're building from the commandline), only a single one like this:
@C:\Qt\Qt5.1.0\Tools\mingw48_32\bin;C:\Qt\Qt5.1.0\Tools\mingw48_32\i686-w64-mingw32\bin;@
Another question: Are you trying to run the final executable outside Qt Creator, by clicking on the executable? To make that work, you have to deploy the application (provide the Qt libraries). There is an official guide to "Deploing an Application on Windows":https://qt-project.org/doc/qt-4.8/deployment-windows.html.
-
Ok.. I am checking the PATH variable, There it is, C:\MinGW\bin. Deleted it.
One thing I noticed while nosing around the project files is that my calqlatr demo has a .pro file that is very small, and then a ".pro.user" file that is associated with VS2012. I was wondering why how that got there.
So having deleted the old MinGW PATH, I tried to buile the Flikr View example and it I got the familiar "exited with code -1073741819"
This time I carefully read the error code. It is the same as before.
As suggested, I looked at both threads related to the code. I found this one, http://www.qtcentre.org/threads/34339-program-crashing-randomly-code-1073741819 to be very interesting, but not much help.
Just to check, i ran the "application example" demo, and it still works. It is, however, and android widget.
I am not trying to run anything outside of Qt. (though I hope someday to have something I can do that with)
I had better do something useful for awhile.
Thanks for the help. I may not be winning, but at least I am learning