Unable to create "Qt Gui Application" with Visual Studio 2010 and Qt version 4.8.0 - c++

I am building a GUI application in which I have to use Visual Studio 2010 build tools. I was told that the correct qt version to use with this VS version is 4.8. I've downloaded Qt 4.8.0 using this link:
https://download.qt.io/archive/qt/4.8/4.8.0/
And I made this version the default in the VS Qt options menu. However, when I try to create a new visual studio project, all of the module options are greyed out.
Which in turn makes it impossible to create the project because upon clicking "next", the "Finish" button is also greyed out. Any Idea of what's going on??

With pre-compiled binaries (that is, you don't have to compile qt yourself) you can use Qt 5.5.1 with VS2010 that you can get from here.
After that, i would create a simple project using qmake and specifying
TEMPLATE = VCAPP
that will tell the qmake (see docs) to generate a .vcprojx file that you can use from VS2010.
Latest Qt version that supports VS2010 is 5.6.3 IIRC, however mind you that even that version is now EOL. (March 2019).
You should try to upgrade to 5.9 or 5.12 (however i am not sure that VS2010 will be able to support those since they rely pretty heavily on c++11 that VS2010 supported very lightly)
P.S. If you'r stuck with Qt4 then greatest version is 4.8.7 (VS2010 supported) that you could get from here

Related

Web Engine in Qt

I have installed the new community version of Qt 5.8 using the Windows installer. Kits for mingw MSVC++ 2013. I have the compilers for msvc++ 2013. I have checked the webengine option too.
I was looking to make a simple browser in qt webengine and I get the error
error: Unknown module(s) in QT: webenginewidgets
I have used
QT += webenginewidgets
in the pro file and, run qmake and I'm still stuck with the same issue.
I am little bit confused since I cannot find anything that could help me anywhere.
What is it that I am doing wrong?
Should I install something else to get webengine or should I download the source and compile it? If so, how?
What is the simplest way to use webengine in Qt?
I believe the new chromium no longer support the 2013 compiler and thus Qt also don't support 2013 compiler so download the 2015 MSVC compiler install it and use the 2015 binaries Kit for Qt 5.8 and every thing works just fine ..
ReInstall Qt Creator and Make sure you Checked QtWebEngine at that time

Qt msvc2013 building with vs2015

Hi I have updated visual studio to 2015 version and I have Qt msvc2013. Qt says that no compilers can make code for this version of Qt, (Qt detected compilers from visual studio). How can I make it working without installing VS2013?
You cannot mix C++ compiled with different major versions of the Microsoft Visual C++ compilers. So you need to either get a version of Qt for Visual Studio 2015, or compile your own one.
At this time, there is not yet an official build of Qt for Visual Studio 2015 available (this is planned for Qt 5.5.1 5.6.0). If you want to try compiling yourself, https://wiki.qt.io/Building_Qt_5_from_Git is a comprehensive guide. You should try either the 5.5 branch (if you get the Qt sources from git), or the 5.5.0 source packages. You should be able to get help e.g. on the qt-interest mailing list.
Adding a new mkspec is pretty simple, just copy the win32-msvc2013 and rename it to win32-msvc2015, then modify and use that one.
Second thing to do is not try to link against 2013 built libraries. If 2015 follows the same pattern as the older one, mixing libraries from different VS version is not possible.
Last thing, before adding icu, OpenSSL and MySQL you rather try to build Qt with the default parameters.
Qt's current development version is 5.6.
It is in beta and there are prebuild binaries for msvc2015.
Link to Qt Development Binaries

Qt <codecvt> : No such file directory

I cant use std::wstring_convert in Qt 5.1, because it said me that <codecvt> : No such file directory. What can I do? I don't know... this code is working at the MSVC 2013.
QtCreator is just a front-end that allows you to edit your source files, it does not contain a compiler. On Windows you need either MinGW or Visual Studio to compile code.
If you want to use Qt 5.1 with Visual Studio 2013, you would have to compile Qt yourself. Digia provides builds for Visual Studio 2010 and 2012. You can find the latest version of Qt here or an old release here.
My advice would be to install Visual Studio 2012 and download a VS2012 build of Qt. Then go to Tools > Options > Build & Run > Kits, click the Add button on the right (or modify the existing one as it probably won't work anyway). Set the compiler to "Microsoft Visual C++ compiler 11.0 (amd64)" if you downloaded the 64 bit version of Qt or "(x86)" if you downloaded the 32 bit version.
Then set the debugger to cdb.exe and the Qt version to the one you just downloaded (if you don't see it, go to the Qt Versions tab at the top, add it, click Apply and the go back to Kits and it should be there). Click ok and your kit should be ready! Make sure that you don't have a warning signal that would point out a potential mistake.
Now open your project and go to the Projects tab (Ctrl + 5) and make sure your project is using the correct Kit.
You should now be all set up properly.
Additionally, if you don't want to install Visual Studio 2012 and want (or have to) work with VS 2013, you can use the Qt 5.3 BETA builds located here. Please note that these builds are in beta and shouldn't be used in production code, if you want to use VS2013 with Qt in production code I would recommend to build Qt 5.2.1 with VS2013, it's not that hard but it can take a while.
You are missing this in your project file:
CONFIG += c++11
You need to make sure that your GCC version (brought to you by mingw) supports that feature though. It is possible that you are using an old version where it was not supported.

Which Qt to download?

I am new to C++ and have been working with MS VISUAL STUDIO 2010 Express. However, I am in need to shift to Qt as my university recommends. Unfortunately, the qt.nokia.com is redirecting to another site http://qt.digia.com/.
Since everything in that site is not free, I found the following link called "Qt Open Source Version". Is this is the site to download Qt?
When I go there, I can see various options, which means number of downloads. I have windows 7 ultimate and got visual studio 2010 express installed in my machine. But, this site got number of windows downloads. I prefer the one which claims to come with the Qt IDE (Qt Creator??). If you need further more information, I will be using this Qt GUI C++ applications with OpenCV.
I have already installed OpenCV and it works with VS so if you can, please tell me how to set it up with Qt as well.
Please help me to download the correct version of Qt. Thanks
Answering to these kind of question is always hard and dangerous!
I know you had experiences with VS but
I'm going to offer you to choose MinGW instead.
Download link
qt-project is the correct place to get open source Qt.
There are prebuilt binaries of Qt 5.0 for VS2012, but if you want to use Qt 4.8 with VS2012 you'll need to compile it yourself, as there are no prebuilt binaries for VS2012 (yet?). Compiling Qt is not difficult, just open command prompt for VS2012, run configure --help to find out how you can customize your Qt build. Then run configure with appropriate parameters, then nmake.
If you decide to use Qt Creator as an IDE you are welcome to do it - Qt Creator can compile projects using different compilers, including VS2012 compiler. But in order to debug projects compiled with VS2012 compiler you'll either need to use VS2012 or install Debugging Tools for Windows (which Qt Creator will find and use to debug VS2012-generated executables).
http://qt-project.org/downloads
Qt 5.0
Select the file according to your operating system from the list below to get the latest Qt 5.0 for your computer. The binary packages include Qt 5.0.2 libraries and Qt Creator 2.7.0
Qt 5.0.2 for Windows 32-bit (VS 2010, 485 MB)

Qt 4.7.1, Qt Creator and VS 2010 installation problems

On my computer (Win7 32, VS2010 Ultimate) I would like to use Qt Creator and Qt Visual Studio add in, both LGPL versions.
There are minGW and VS2008 versions of Qt frameworks on the Nokia websites, I did not find VS 2010 version.
So I have installed Qt 2010.05 SDK and in the VS 2010 Command prompt the following steps have been performed:
configure -static
nmake sub-src
I checked Qt Creator and it successfully runs. After the translation has been finished I installed VS 2010 add I tried to add new Qt version int the path
C:\Qt\2010.05\qt
But the following error message has been appeared:
Qt in the given path was built using minGW
It do not understand why because the translation has been performed for the VS2010.
Where is the error? How to install it correctly?
I found out from a German Qt forum that, VS add-in looks for libqtmain.a and libqtmaind.a files to determine if it is built with MinGW. Guess what? Qt ships with those files.
Delete them, and you will be fine.
FWIW, The Vs2008 version works fine with VS2010. I didn't need to build it or anything. You can install that and then just run the latest version of the VS plug-in installer and you should see the Qt menu options in VS2010.
AFAIR your command line is incomplete: I remember one had to specify the build platform. It could be that it's using mingw to build Qt since you didn't specify the VS version in the parameters. The following post might be of interest to you: Building Qt 4.5 with Visual C++ 2010