creator switching between debug and release modes


  • Moderators

    Once in awhile I run into the problem that some code is obviously not compiled. Unfortnautely it typically takes too long until one recognizes.

    I have a project based on subdirs template and there is an application compiled with a serious of dlls. In order to have a consistent solution I had rerun qmake and a rebuild. The application had been compiled and generated in release mode. This application is started in parallel a couple of times and a special configuration had problems and needed debugging. I led the other applications continue to run in release and simply change the settings while clicking on the left lower corner project button and changed to debug.

    Most likely neither the application nor its dlls had been compiled, which was ok since all was in the right state. I had started the application a couple of times in debug mode while pressing F5 and narrowed down the actual problem and fixed it. I started the build which not be finished because the dll with the fix could not be written, because it was used by a process. I stopped all those processes still running in release mode and started the build again. This time it completed successfully.

    Starting all my processes in release mode was successful. Also the application with the special settings. I have checked and the dll has been compiled in release mode. However, the setting in creator still says debug.

    I can't believe that this is possible. I would expect that creator is switched and the proper make files, in my case the version with debug settings is used. However, it obviously is not.

    Is this a known issue?


  • Lifetime Qt Champion

    Hi,

    I'm not aware of such a case but I wouldn't be surprised that you found out something.

    Can you reliably reproduce this ?


  • Moderators

    @SGaist

    I have not tried to reproduce it in small sample case, yet. I seem to have this issue already quite some time and it is not limited to creator v4.1.0 and dates back to at least v3s.

    Anyway in past I used self-compiled versions and I was not sure if my .pro, .pri are setup in wrong way and causing my issues. On the other we all were getting used to rerun qmake and rebuild.

    Some time ago I have my naming convention of targets. I do it as Qt libs and add a 'D' for debug. This allows debug and release of the same application running at the same time. Also you change some dlls for debugging while those are used by other apps.

    Anyway I noticed that some times apparently the dlls are produced in the wrong mode. BTW this is on win 10 64 bit.


  • Moderators

    Did some simple tests and unfortunately cannot reproduce with small sample.

    I have created a default application with

    QT += core
    QT -= gui
    
    CONFIG += c++11
    
    TARGET = ModeTest
    CONFIG += console
    CONFIG -= app_bundle
    
    TEMPLATE = app
    
    CONFIG(debug, debug|release):TARGET = $$join(TARGET,,,"DebugMode")
    message("TARGET     " $$TARGET)
    
    DESTDIR = c:/Source/Utilities
    
    SOURCES += main.cpp
    

    and

    #include <QCoreApplication>
    
    int main(int argc, char *argv[])
    {
        QCoreApplication a(argc, argv);
    
        return a.exec();
    }
    

    When changing on the left side in creator from debug to release forward and back the name of the exe is always correctly displayed based on chosen on chosen mode. Also the exe can be produced and file sizes are as to be expected.

    As next I have added a subdirs project which is using the project above.

    TEMPLATE = subdirs
    
    SUBDIRS = ModeTest
    
    ModeTest.subdir = ../ModeTest
    

    The same. My problem cannot be reproduced easily. Possibly the problem is triggered by other actions in between, but no clue at the moment.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.