Re: [Interest] Use Qt release DLLs while debugging application

2018-04-24 Thread Thiago Macieira
On Tuesday, 24 April 2018 22:35:00 PDT Rainer Wiesenfarth wrote:
> ​Note: You have to make sure that any other library you link against is
> using the same C runtime​

And that's exactly the problem. With MSVC, the definition of "debug" and 
"release" can take one of two meanings: optimised or not versus the runtime 
it's linking against. By default, people build non-optimised code (/Od) with 
debugging symbols (/Zi) against the debug runtime (/MDd). But you can compile 
optimised code (/O2) against the debug runtime (/MDd) and you can compile non-
optimised code with debugging symbols (/Od /Zi) against the release runtime 
(/MD).

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center



___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Use Qt release DLLs while debugging application

2018-04-24 Thread Henry Skoglund

On 2018-04-25 07:35, Rainer Wiesenfarth wrote:
*You can, if* you are interested in the debug code of your application 
only, but not in the one of Qt and the C runtime.


If you use the release version of Qt, you have to make sure that you 
link with the same runtime, i.e. you use /MD (Mulit-threaded DLL) for 
your debug build instead of /MDd (Multi-threaded Debug DLL).


​Note: You have to make sure that any other library you link against is 
using the same C runtime​
Note: I have no idea how to configure this using QMake (we use 
hand-crafted .vcxproj and .props)


​Cheers, Rainer​


Morning, just want to add, qDebug() output works fine in Release builds 
also. I.e. just printf()-style debugging but sometimes that's all you need.


Rgrds Henry

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Use Qt release DLLs while debugging application

2018-04-24 Thread Rainer Wiesenfarth
On Tue, Apr 24, 2018 at 10:34 PM, Thiago Macieira  wrote:

> On Monday, 23 April 2018 22:34:20 PDT Hamish Moffatt wrote:
> > This must be an FAQ, but can I use the Qt release mode DLLs while
> > running my application compiled for debug? (In Visual Studio 2015, Qt
> 5.8).
> >
> ​[...]
>
>
> You can't do that because of Microsoft (see Gunnar's reply).
> ​[...]
>

​This is only half the truth:

*You can, if* you are interested in the debug code of your application
only, but not in the one of Qt and the C runtime.

If you use the release version of Qt, you have to make sure that you link
with the same runtime, i.e. you use /MD (Mulit-threaded DLL) for your debug
build instead of /MDd (Multi-threaded Debug DLL).

​Note: You have to make sure that any other library you link against is
using the same C runtime​
Note: I have no idea how to configure this using QMake (we use hand-crafted
.vcxproj and .props)

​Cheers, Rainer​

-- 
Software Engineer | Trimble Imaging Division
Rotebühlstraße 81 | 70178 Stuttgart | Germany
Office +49 711 22881 0 | Fax +49 711 22881 11
http://www.trimble.com/imaging/ | http://www.inpho.de/

Trimble Germany GmbH, Am Prime Parc 11, 65479 Raunheim
Eingetragen beim Amtsgericht Darmstadt unter HRB 83893,
Geschäftsführer: Dr. Frank Heimberg, Jürgen Kesper
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Use Qt release DLLs while debugging application

2018-04-24 Thread Thiago Macieira
On Monday, 23 April 2018 22:34:20 PDT Hamish Moffatt wrote:
> This must be an FAQ, but can I use the Qt release mode DLLs while
> running my application compiled for debug? (In Visual Studio 2015, Qt 5.8).
> 
> I looked through the mkspecs and it doesn't seem possible. The
> qtPlatformTargetSuffix function defined in qt_functions.prf always adds
> the d suffix when compiling for debug.
> 
> 
> I ask because I'm not debugging Qt, and the XML parsing in Qt5Xml seems
> to be horrendously slow in debug mode. It's using 45% of my total CPU
> time, versus 11% in release mode. I'm not actively debugging anything
> remotely related to XML but this is killing debug time for me.

You can't do that because of Microsoft (see Gunnar's reply).

But you can recompile the debug library with optimisation enabled. Or you can 
compile your release binary without optimisations and with debug symbols.

Exercise left to the reader.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center



___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Use Qt release DLLs while debugging application

2018-04-24 Thread Gunnar Roth
I would recommend setting the /Zo option for enhanced debugging 
information

in your application release build.  ( is default in vs 2017).
Alternatively you can change disable your optimisation in release build 
with /Od.


you CANNOT use a qt application debug build with Qt realease dlls, 
because that will crash , due to using a mix of release and debug 
c-runtime dlls, which have different memory allocators. The debug c 
runtime will allocate extra bytes for debugging purposes, which the 
release allocator does not know of. So it crashes if you allocate with 
the debug allocator and delete with the release allocator or vice versa.


Regards,
Gunnar Roth



-- Original Message --
From: "Hamish Moffatt" 
To: "interest@qt-project.org" 
Sent: 24/04/2018 07:34:20
Subject: [Interest] Use Qt release DLLs while debugging application

This must be an FAQ, but can I use the Qt release mode DLLs while 
running my application compiled for debug? (In Visual Studio 2015, Qt 
5.8).


I looked through the mkspecs and it doesn't seem possible. The 
qtPlatformTargetSuffix function defined in qt_functions.prf always adds 
the d suffix when compiling for debug.



I ask because I'm not debugging Qt, and the XML parsing in Qt5Xml seems 
to be horrendously slow in debug mode. It's using 45% of my total CPU 
time, versus 11% in release mode. I'm not actively debugging anything 
remotely related to XML but this is killing debug time for me.



Hamish

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Use Qt release DLLs while debugging application

2018-04-23 Thread Hamish Moffatt
This must be an FAQ, but can I use the Qt release mode DLLs while 
running my application compiled for debug? (In Visual Studio 2015, Qt 5.8).


I looked through the mkspecs and it doesn't seem possible. The 
qtPlatformTargetSuffix function defined in qt_functions.prf always adds 
the d suffix when compiling for debug.



I ask because I'm not debugging Qt, and the XML parsing in Qt5Xml seems 
to be horrendously slow in debug mode. It's using 45% of my total CPU 
time, versus 11% in release mode. I'm not actively debugging anything 
remotely related to XML but this is killing debug time for me.



Hamish

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest