April 25, 2011

mirswith mirswith
Lab Rat
125 posts

release app building debug versions

 

Hi. I am having a problem where my debug cases in my .pro files are being built when I have my projects set to release. Here is the lay of the land.

I have two projects. One is a DLL and one is an EXE, both are open in a single instance of Qt Creator. My EXE uses the DLL.

My dll has this section for its debug and release differences:

  1. win32:debug {
  2.  LIBS += ../../common/openAL/windows/libs/Win32/OpenAL32.lib \
  3.   ../../common/boost_1_46_0/stage.win32/lib/libboost_system-vc90-mt-gd-1_46.lib \
  4.   ../../common/boost_1_46_0/stage.win32/lib/libboost_filesystem-vc90-mt-gd-1_46.lib
  5. }
  6.  
  7. win32:release {
  8.  LIBS += ../../common/openAL/windows/libs/Win32/OpenAL32.lib \
  9.   ../../common/boost_1_46_0/stage.win32/lib/libboost_system-vc90-mt-1_46.lib \
  10.   ../../common/boost_1_46_0/stage.win32/lib/libboost_filesystem-vc90-mt-1_46.lib
  11. }

And my EXE has these differences:

  1. win32:debug{
  2.  LIBS += ../MyDLL/MyDLL-build-desktop/debug/MyDLL.lib
  3.  PRE_TARGETDEPS = ../MyDLL/MyDLL-build-desktop/debug/MyDLL.dll
  4.  QMAKE_PRE_LINK = copy /Y "..\\MyDLL\\MyDLL-build-desktop\\debug\\MyDLL.dll" "debug\"
  5. }
  6.  
  7. win32:release{
  8. LIBS += ../MyDLL/MyDLL-build-desktop/release/MyDLL.lib
  9. PRE_TARGETDEPS = ../MyDLL/MyDLL-build-desktop/release/MyDLL.dll
  10. QMAKE_PRE_LINK = copy /Y "..\\MyDLL\\MyDLL-build-desktop\\release\\MyDLL.dll" "release\"
  11. }

Now when I set Release mode for both of my projects and do a clean all/build all I am getting debug versions of msvcrt built into my release mode., if I comment out the debug sections in my .pro files then my build is correct without any debug libraries.

Any ideas?

Thanks.

-=ben

2 replies

April 25, 2011

Gerolf Gerolf
Area 51 Engineer
3210 posts

Hi ben,

what I do is the following, and it works:

  1. CONFIG(debug, debug|release)
  2. {
  3.     DESTDIR     = ../debug
  4.     OBJECTS_DIR = ./tmp/debug
  5.     MOC_DIR     = ./tmp/moc/debug
  6. }
  7. else
  8. {
  9.     DESTDIR     = ../release
  10.     OBJECTS_DIR = ./tmp/release
  11.     MOC_DIR     = ./tmp/moc/release
  12. }

 Signature 

Nokia Certified Qt Specialist.
Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

April 25, 2011

mirswith mirswith
Lab Rat
125 posts

That works. Thanks! Strange the other approach does not.

-=ben

 
  ‹‹ VS2005 add ce build - THis Qt version is not compatible to your current VS      osx dylib ››

You must log in to post a reply. Not a member yet? Register here!