I have a QT project that loads a QML project. I've have no problem debugging the QML part of the program when I run it from QT Creator. I've added
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG ")
to my CMakeLists.txt and checked the "Enable QML" under "Debugger Settings" in "Project->Run"
But I would like to debug from Visual Studio, since that is the environment we usually work in.
Is it possible to manually do what QT Creator does when you check the "Enable QML" box, to activate debugging from Visual Studio? Attach to some process or similar?
I've tried to figure out what the "Enable QML" box actually does. But I've not been able to find any good explanation about this.
We use CMake to build, MSVC as compiler and CDB as debugger. The projects are in QT5.5 and QT Quick 2. Visual Studio is version 2015 Professional and QT Creator is version 4.1.0.
Since Qt Visual Studio tools 2.3, released in Oct 2018, the QML debugger is included and usable from Visual Studio :)
Related
I am getting this error while compiling my Fortran code in VS Studio:
warning #31001: The dll for reading and writing the pdb (for example, mspdb110.dll) could not be found on your path.
I also looked to change the Base Platform Toolset in Project Properties, but in VS 2019 IDE I couldn't find this option to edit it.
I am using Intel Compiler 2021. I have also tried upgrading my VS Studio to latest version but the problem persists.
Please tell how to fix this.
This message is saying that your Visual Studio is misconfigured. Make sure that you have the "Desktop Development for C++" and "Windows 10 SDK" components of Visual Studio installed (see https://www.intel.com/content/www/us/en/developer/articles/guide/installing-microsoft-visual-studio-2019-for-use-with-intel-compilers.html) You may need to uninstall both the Intel compiler and Visual Studio, then reinstall.
I am using Visual Studio 2013, but I'm in need to develop an old project using the Visual C++ 6.0 compiler.
For this purpose, I have been using Daffodil with no problem on Windows 8.1 for a while.
(You can read more how to use the VC++ 6 compiler in newer Visual Studio versions in this StackOverflow question: Is it possible to use the VC++ 6 compiler in Visual Studio 2012?)
Now I got a new Windows 10 machine, where I reinstalled Visual Studio 6, 2010, 2013 and Daffodil.
Using v60 build tools (Visual C++ 6.0 compiler), project gets compiled fine.
However, when I try to debug, VS says that "debugging information does not match", and I am unable to set breakpoints etc., but:
PDB file is there, same folder and name of debug executable;
Application built in Debug mode, with debug information enabled;
Debugger works fine when using Visual Studio 2010 or 2013 build tools;
Debugger works fine if opening the project inside Visual C++ 6 IDE.
I tried reinstalling all Visual Studio versions as well as Daffodil, but didn't solve.
Any clue what could the problem be?
Finally I actually found a working solution!
for VS 2013:
Enable "Native Edit and Continue"
under Tools->Options->Debugging->Edit and Continue
for VS 2015:
Enable "Use Native Compatibility Mode"
under Tools->Options->Debugging->General
I've installed Qt4.7.4 as explained on this page:
http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/
and I also installed the last version of the visual studio plugin (1.9.1).
I can create qt project, compile and run them with visual studio. However when I want to open a .ui file or the qt designer (Qt -> launch designer) I get the following error:
"No default Qt version found. Please check your Qt visual studio Add-in settings."
I already reinstalled the qt visual studio plugin but it didnt helped.
The right Qt version is also set in the options of the add-in (Qt -> Qt version)
I'm currently having issues installing Qt (Open Source Edition) such that I can use it in integrated into Visual Studio 2010. I realize that the 2008 edition will have deployment issues, and so I installed it from the source, only to be missing qtmaind.lib.
Anyways, I was looking around for a solution to this, and I came upon this: http://doc.qt.io/qt-4.8/install-win.html, which states:
Open Source Versions of Qt is not officially supported for use with
any version of Visual Studio. Integration with Visual Studio is
available as part of the Qt Commercial Edition.
Anyways, I thought maybe this was the reason I was having problems, and so I wanted to ask the following question:
Is it possible to integrate Open Source Qt into Visual Studio?
Absolutely. I use Qt 4.7 integrated with Visual Studio 2005.
I configured Qt this way:
configure -debug-and-release -opensource -shared -ltcg
-no-accessibility -no-qt3support
Once Qt was built (via nmake), I also installed the Qt Visual Studio Add-in.
Right now I have some libraries that link easily to Visual Studio projects but I can't figure out how to link them with Qt. My idea is to write a VS project that wraps the functionality I need from the libraries, then compile that to a library which can be linked to Qt. From my understanding, VS and Qt use compilers that create incompatibile libraries. My questions are:
Can I modify VS or Qt in a way that I can compile a library in VS which can be linked to Qt?
Is there a simpler solution to this problem?
The specific library I'm using is Nitro-Nitf. For my Qt project I'm using Qt Creator and for Visual Studio I'm using VS 2008.
Yes, the Windows binaries provided by Qt are built using MinGW. If you build Qt from source using Visual Studio, then your libraries will be compatible.
Although I haven't tried it, Qt Creator 1.2 introduces support for MS compilers, so you should be able to continue to develop your Qt projects in Creator.
Qt is available as source code, you can build it with whatever toolchain you like. Visual Studio is an IDE (integrated development environment) that normally invokes the microsoft compiler (cl) and linker (ld), although you can configure a Visual Studio project file to do a makefile build, or IIRC, invoke any other program you like to do the build step (at my previous job, we built our Qt apps with cl and ld, and could debug with Visual Studio just fine, since about 2005).
Also, it appears this "NITRO" project is open source, so you can download the source instead of a pre-built binary, and build it using MinGW if you'd like to build Qt apps with MinGW, or if you are using pre-built Qt libraries that were built with MinGW.
To build Qt4.5 with visual studio
Download the source
./configure.exe -platform win32-msvc2008 or win32-msvc2010
nmake
There is even a free release of the visual studio plugin to make handling all the autogenerated code automatic in visual studio