Qt Creator 5 - No debugger set up - c++

I was seted up a compiler to Microsoft Visual C++ x86 Compiler, but now i have this error:
The compiler "Microsoft Visual C++ x86 Compiler" cannot produce code for the Qt version.
Warning: No debugger set up
I guess that i need to set debugger, but i don't know which path to put Debugger tab.
I have installed Visual Studio 2012.

For binary version of SDK, you need MSVS2010, Express version should be ok. SP1 must be installed on top of these too.
For debugging you also need to install Windws SDK 7.1 and SP1 update for it.
Links in this answer:
https://stackoverflow.com/a/14089968/1717300
If you want to use MSVS2012, I think you still have to compile yourself. Instructions:
http://qt-project.org/wiki/Building-Qt-5-from-Git

Related

Installing Qt 5.5 on Windows 7

I would like to install latest version of Qt (5.5) on Windows 7 for C/C++ application development, and have a few questions:
Can I use Microsoft "Visual Studio Community" edition (2015) as the compiler?
I assume I need to install Visual studio first and then Qt?
I am going to install Qt from here, after downloading and installation do I need to build Qt? Or it is ready to go?
Is there a tutorial that explains all the required steps in details. I have done Google search and found bits and pieces here and there not not a good complete step-by-step reference.
Thanks for the help.
You need the compiler, which is integrated in visual studio. I don't think you can get the newer ones without Visual Studio (From official sources). However, you can use Qt on windows without msvc. You can build with the minGw compiler - but I personally like msvc more.
Regarding VS2015: It won't work without extra configuration. Qt 5.5 supports msvc2013 only (the next release, 5.6, will support the msvc2015 compiler). But Visual Studio 2013 will work. The order of installation doesn't matter.
After you installed Qt, all you need to do is launch Qt-Creator and start coding ;) If you wan't to use Visual Studio instead, there is a Plugin on the bottom of the download page ("Other downloads"). Visual Studio 2015 isn't supported here too, but 2013 is.

Pretty printing of a QHash with CDB under Qt Creator

I'm using the following compilers:
MinGW 4.9.2 32Bit
Microsoft Visual C++ Compiler 12.0 (x86)
with the following debuggers, respectively:
GNU gdb 7.8 for MinGW 4.9.2 32Bit
CDB (\Windows Kits\8.1\Debuggers\x86\cdb.exe)
with Qt Creator 3.5.0 and Qt 5.4.2.
What I would like to see is the pretty printed ("high level") interpretation of a QHash within the debugger watch view. See e.g. this post: https://blog.qt.io/blog/2009/06/22/peek-and-poke/
The pretty printing works with gdb + MinGW but not with CDB + MSVC2012. In the latter, I can only see the 'low level' interpretation.
What do I have do to get this work with CDB + MSVC2012 too?
You will need to add a correct debugging addin dll into the visual studio installation directory C:\Program Files\Microsoft Visual Studio ${num}\Common7\IDE or preferably the add-in directory ( default is %USERPROFILE%\Documents\Visual Studio ${num}\Addins).
Qt already provide a complete set of tools for MSVC integration which can be built from one of the qt git vstool project.
There is a wiki which provide a step by step guide to make it work. Basically :
get the project from repository
create the solution files
build the correct solution, as there is one for each pair Qt4\Qt5 x VsVersion
Copy the target dll to the addin directory.

How to compile C++ for Windows with clang in Visual Studio 2015

As far as I understand, Visual Studio 2015 is shipped with clang. First I though this was only for Android and iOS apps, but according to this article it should also be possible to use the clang++ frontend for Windows programs. However, I can't find the according option.
So could you please explain to me, how I can change the used compiler to clang in a c++ project (in VS2015 RC Community Edition).
Starting with VS2015 Update 1 you can install the "Clang with Microsoft CodeGen" template via the New Project window, browse to Installed -> Templates -> Visual C++ -> Cross Platform.
You will then be able to choose the Clang 3.7 with Microsoft CodeGen v140_clang_3_7 Platform Toolset in the properties page of any Windows C++ project.
Clang has a completely different set of command-line options which it recognizes, so when using the v140_clang_3_7 toolset, the project properties must be using Clang-compatible options, which can be recognized as starting with - instead of /. For example, Debug Information Format property set to "Full Debug Information (DWARF2) (-g2 -gdwarf-2)", and Enable C++ Exceptions property set to "Yes (-fexceptions)".
There's more information in this blog post.
As far as I understand it both Clang and GCC are shipped with the Android and iOS crossplatform SDKs/tools for Visual Studio 2015.
From what I've seen it only allows me to choose those while having one of those crossplatform projects.
Using the template project for a GLES C++ application you get the following options:
While for a Windows C++ application you get the dialog below where you can see that Windows target platform is grayed out and read-only, meaning you probably have a set of toolkits for each target platform, but you simply cannot change it, at least for now.
Have no idea how you turn a normal VS project into crossplatform though, and it's likely that you can only target Android or iOS out of the box using 3rd party compilers.
It may be possible, though, to install Clang as another toolkit in the same way the XP toolkits are. So perhaps it's just a matter of someone fiddling with it and making it available as it is already installed.
Caveat: This answer is pre-VS2015 update 1 which didn't have the "Clang with Microsoft CodeGen" option.
After reading through the linked post and especially the comments again, I came to understand, that this is not a feature shipped with VS2015 RC but a possible future feature that might e.g. be shipped in a SP or (more likely) with the next version of VS.
As mentioned by sjdowling, the closest thing you can do at the moment (October 2015, clang 3.7) is to download and install llvm for windows. This should give you a LLVM-vs2014 platform toolset option. For me it works for simple test programs, but apparently this version of "clang-vs" seems to not yet support exceptions. However, according to these notes, that problem should be mostly solved for clang 3.8.
While the above solutions work they require that you have installed clang which is off by default in the visual studio 2015 installation. The accepted answer does show how to install it, though the next page will ask you to close visual studio which you are running the new project from.
If anyone is wondering how to install clang because it does not show up in their list here is another solution:
Control Panel->Programs->Programs and Features.
Right click on “Microsoft Visual Studio Enterprise 2015” (or
“Microsoft Visual
Studio 15 Preview” if you have the preview of the next version of
Visual Studio installed)
Click “Change”
Click “Modify”
Select “Clang with Microsoft CodeGen” – The March 2016 release.
https://blogs.msdn.microsoft.com/vcblog/2016/03/31/clang-with-microsoft-codegen-march-2016-released/

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.

c++: How to debug a C++ application compiled using the "Microsoft Visual C++" toolchain in eclipse?

I have installed Eclipse CDT and CDT Visual C++ Support (from the Yoxos Marketplace).
This lets me compiled and run a C++ application, however, I cannot debug it.
So, I have installed a gdb windows binary using the mingw distribution. Now, when I try to debug, the following message is displayed in the console - No symbol table is loaded. Use the "file" command.
My uneducated guess is that gdb cannot debug binaries produced by the Visual C++ compiler.
My question is - how do I debug C++ code in eclipse built using the Visual C++ toolchain?
My environment:
Windows 7 64 bits
Eclipse Indigo (the latest version at the moment)
Visual Studio 2010, hence Visual C++ ver 10
GNU gdb (GDB) 7.3.1
I do not know how to get the version of CDT, but I have this jar - org.eclipse.cdt_8.0.0.201109151620.jar, so I guess the version is 8.0
Thanks.
P.S.
Moving to the MinGW g++ compiler is off scope for this question, so please - do not suggest it as the answer.
Please follow this https://bugs.eclipse.org/bugs/show_bug.cgi?id=162108
Summary:
As of the last comment (Doug Schaefer 2012-03-13 10:49:27 EDT) in this bug it seems there are plans to integrate this but it is not yet working.
As far as I know you can't debug Visual C++ applications using gdb which is only supported by CDT plug-in.
Debugger for Visual C++ toolchain is called CDB and you have to search for the tool that can use it. For sure Visual C++ IDE (even from Express Edition) can be use to debug application that are compiled under Eclipse+CDT. I think that also some nightly builds of CodeBlocks IDE can cooperate with CDB.