views:

55

answers:

1

According to various soures, for a Qt4 app you build the release or debug versions with "make release" or "make debug". In real life, these give errors.

make: *** No rule to make target `debug'.  Stop

Only bare naked "make" works. I'm not sure what it produces. Running "strip" does reduce the executables' size, but gdb isn't finding symbols in the unstripped file. I'm using, qt4.6.2 on Arch Linux.

So what is the proper way to determine whether to make release or debug?

+1  A: 

Add

CONFIG += debug_and_release

to your .pro file, then re-run qmake. You will then have the debug and release (capitalization!) targets available.

Mihai Limbășan
Okay, works, except the targets are all lower case for me. "make release" is okay, but "make Release" doesn't find a target. Nonetheless, this answer got me going, so thumbs up!
DarenW
Must this line always be added manuallY? Seems qmake -project won't put it in.
DarenW
Oops, my bad, obviously you're right, had that remembered wrong... Editing the answer appropiately.
Mihai Limbășan
And yes, by default the .pro generator doesn't include this. Conceivably, you could edit the .prf files in mkspecs to change the defaults, but it's not that much of a hassle and I tend to avoid changing the vendor-supplied defaults files if I have a choice.
Mihai Limbășan