0

I recently decided to upgrade from Qt 4.X to 5, though now it has only vs2010 supported. Whenever I start Qt Creator I get that there isn't any compiler (and there are no options in the settings to set one).

Question: How do I download the vs2010 compiler? Do I have to download vs2010 itself? Will I get a debugger as well?

I have tried this suggestion, but Qt didn't pick up the compiler: Using Visual Studio as a Compiler for QT Creator

Sorry if this question have been asked before, but I have been unable to find a source that explains what I should do.

Community
  • 1
  • 1
John Mikael Gundersen
  • 714
  • 1
  • 10
  • 25

2 Answers2

1

Seems like you didn't install MSVC yet. Get it from Microsoft website.

Than download sources from Nokia. Unpack them to a new folder e.g C:\QtSources and compile them with MSVC. This instructions are working just fine.

Finally add them to Qt Creator in

Tools -> Options -> Building -> Qt Versions 

by poiting to your new qmake executable in

C:\QtSources\bin\qmake.exe

Hope Qt 5 will work with free Express Edition of MSVC.

Community
  • 1
  • 1
makciook
  • 1,537
  • 10
  • 19
1

You shouldn't need to re-compile Qt, as the SDK version is built with msvc2010 32-bit. For debugging, you may need to download the Windows SDK 8. Qt Creator may auto-detect your compiler and debugger, but if not, proceed as follows:

  • Under Options/Build & Run/Qt Versions, point to qmake.exe
  • Under Options/Build & Run/Kits, set "Qt Version" to the one you just created, and set your compiler and debugger

The compiler should be auto-detected if it's on your system.

The debugger is something like C:\Program Files\Windows Kits\8.0\Debuggers\x86\cdb.exe.

Good luck!

typelist
  • 121
  • 3
  • problem is that under qt versions it says that "no compiler can produce code for this version of Qt. Please define one or more compilers." Under compilers nothing can be found, though I have a msvc2010 folder in my qt5.0.0 folder. Basically I have a fresh download of the qt 5 sdk and I have installed it, yet it does not work. – John Mikael Gundersen Jan 29 '13 at 19:08
  • 1
    The compiler comes with [Visual Studio 2010 Express Edition](http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express), not with Qt (scroll down to "Visual C++ 2010 Express"). The msvc2010 folder is for Qt binaries compiled with msvc2010. – typelist Jan 29 '13 at 19:25
  • 2
    MSVC2010 comes with the Windows 7 SDK; you don't need Visual Studio. – Mitch Jan 29 '13 at 20:29
  • 1
    Qt Creator was not able to find msvc2010 prior to me installing vs2010. Anyway, the initial problem is solved and thus next one appear where all Qt includes are "cannot open include file: 'QWidget(or whatever)': No such file or directory", but at least I am one step closer, so thanks. – John Mikael Gundersen Jan 29 '13 at 21:19
  • Does this happen for all Qt headers? Does anything change if you write #include instead? Do you have QT += widgets in your .pro file? In the "Qt Versions" menu, click on "details" at the bottom--what's the value of QT_INSTALL_HEADERS? (In any case, all the headers you need will be in subdirectories of `your_qt_sdk_dir\5.0.0\msvc2010\include`, and Qt Creator should be able to find them without you setting environment variables manually.) – typelist Jan 29 '13 at 22:32