Qt World Summit: Register Today!

[Solved] Build problem in Qt Creator

  • Hi everyone,

    I'm using Qt Creator 2.4.1 Based on Qt 4.7.4 on windows 7.

    When I run or build the application it is not working the way it should.

    For example

    qDebug() << "This is first";

    shows the text 'This is first'. But even if I change it to

    qDebug() << "This is second";

    sometimes it still shows the text 'This is first'.

    This is not occurring every time.

    Is there any way to fix it?

    Thanks in advance.

  • Lifetime Qt Champion


    Do you mean in the console output of QtCreator ? Did you clear the console output ?

  • Thanks for replying..

    Not only in the console output. Sometimes it not build the changes of source code.

  • Lifetime Qt Champion

    Are you sure the change have been saved ?

    Do you run the application using the CTRL+R or the green arrow on the Application Output Pane ?

  • I set to autosave the changes when press large green arrow on sidebar. So I'm not manually save.

    I run the application by large green arrow not an small one.

    The problem is the results are not repeatable every time. Sometimes it build the changes and sometimes not. The problem occurs today. I'm working with qt since few months without this type of problem.

    Thank you very much for helping me..

  • Lifetime Qt Champion

    Is your code in a static library ?

  • Sorry for the delay. I'm out of office.

    Difficult question for me. I'm beginner. :)

  • Lifetime Qt Champion

    In that case, can you describe your project (template used etc...) ?

  • @Hareen Laks

    It looks to me that your application is not compiled every time you have changed the code. You have apparently a very simply application with presumably just some few files, so it has only a limited complexity. So it is a bit strange.

    Whenever you change code you should save it (ctrl+s to save one file, ctrl+shift+s for all files changed) before compilation (ctrl+b or ctrl+shift+b). You can perform the same tasks through the menu. Sometimes it may be helpful to do a complete recompile or a "Run qmake". Especially switching between release and debug modes seems sometimes to confuse qt creator. The recompile and rerun of qmake recommendation are based on my personal experience with large projects on windows 7 with qt creator 2.6.0. Therefore, I find it a bit strange that similar problems are existing with smaller projects.

    Furthermore, you might want to update your installation. From my viewpoint at least qt creator which is now in version 2.7. You may to continue to use the new creator version with Qt 4.7.4 if you do not want to change that one for any reason. However, when starting with Qt there are probable no restrictions (other than limited disk resources on old HW) to install the new Qt SDK with e.g. MinGW compiler, Qt creator and Qt 5. Having a consistent new setup might solve also some problems. BTW if you have enough disk space, you can leave Qt 4.7.4 on your machine and build with both tool chains.

  • @ SGaist, koahnig

    I reinstall the Qt creator and still it is working fine.

    But unfortunately, I haven't know idea because of what it is occurred.

    Thank you very much for both of you..

Log in to reply