[Qt-interest] CONFIG(debug, debug|release) fails

David Ching dc at remove-this.dcsoft.com
Sun Jan 31 00:27:20 CET 2010


"Matthias Pospiech" <matthias.pospiech at gmx.de> wrote in message 
news:4B648C97.6050703 at gmx.de...
> I am using this construct:
>
> LIBRARY_NAME = source-highlight
> CONFIG(debug, debug|release) {
>  win32:$$LIBRARY_NAME = $$join($$LIBRARY_NAME,,,d)
> }
>
> which works in all project I use so far. But here
> in debug mode the name is
>    source-highlight
> and in release mode it is
>    source-highlightd
>
> which is the the opposite of what I want.
>
> How can I debug this problem?
>

I have a persistent problem that when I switch building the debug version to 
release version (and vice-versa) and rebuild, sometimes the wrong one gets 
built.  For example, in a .pro file that has a couple libraries and a .exe, 
the libraries need to be built before the .exe, but if I am doing a debug 
build, one of the libraries is built in debug, the other is built in 
release, and the .exe is built in release but it fails because it can't find 
the library that was wrongly built in debug (because it is put into the 
debug output folder instead of the release folder).

So, for me, with Qt Creator on Windows (and I believe I have experienced the 
same thing on Linux), I have never gotten very good behavior when switching 
builds from debug to release and vice versa.  The only remedy I have found 
in this case is to search for and delete all the qmake generated makefiles. 
Then when I rebuild, qmake regenerates the makefiles, and it seems to work. 
I believe I also had to delete the <cached .pro file> (I forget what it's 
named, it's in the same folder as the .pro file).

This is a shame, but this newsgroup (and the Qt Creator one also) is filled 
with tales of woe regarding qmake having to do with case sensitivity and 
syntax.  For example, a similar problem occurred if you put the '{' in

  CONFIG(debug, debug|release) {
      win32:$$LIBRARY_NAME = $$join($$LIBRARY_NAME,,,d)
  }

on a separate line instead of at the end as shown above.  The symptoms 
change as new Qt versions emerge, but this is no doubt one of the weak 
points of the Qt system that is never quite right.  Then you read about how 
even internal Qt engineers don't understand qmake, the code is a mess so no 
one can understand it, the documentation is not very good, etc. and a 
replacement is far away.

Anyway:  try deleting the qmake generated makefiles and try again.

-- David
 




More information about the Qt-interest-old mailing list