Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [solved (project dependencies)] Debugger misbehaves
Forum Updated to NodeBB v4.3 + New Features

[solved (project dependencies)] Debugger misbehaves

Scheduled Pinned Locked Moved Qt Creator and other tools
8 Posts 2 Posters 2.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Using QtCreator 3.01 with Qt 5.2.1 while debugging I experience some strange debugger behavior

    1. I can't step into some of my functions. Debugger steps over the function instead. (caller and callee are in the same library)
    2. Debugger does not stop at some (but not all) breakpoints

    The only cure seems to be a complete clean all, followed by build all. But then after changing the source problems repeat all over forcing me to do time consuming rebuild all over again.

    I admit being inexperienced with QtCreator. Am I doing something wrong?
    (I am sure that I am building Debug not Release)

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      An odd thing that I noticed is that the clean command does not delete static library (my project consists of static library and application that uses it). Shouldn't make kill and totally rebuild *.a when one of the sources changed? I am guessing that is not happening but should and therefore resulting application uses previous version of the code and causes debugger misbehaving.

      Plausible? Is it a bug somewhere or did I inadvertently mess up *.pro which in turn messed up makefile?

      1 Reply Last reply
      0
      • A Offline
        A Offline
        apoenitz
        wrote on last edited by
        #3

        Getting project dependencies not right is a plausible explanation.

        Does you stepping work after a clean build?

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          You must be right and the problem must relate to qmake / makefile. My application consists of a static library (sub-project) and gui application. When I make changes to library sources and rebuild application behaves like it still uses old version of sources. If I delete both *.a of a library and *.app then after rebuild I see effects of code changes. Unfortunately my experience is mostly with Visual Studio, so I would appreciate help in understanding and fixing *.pro files.

          Here is the outline of what I have

          @

          myproject.pro

          TEMPLATE = subdirs

          CONFIG += ordered

          SUBDIRS +=
          myCore
          myUI

          mycore.pro

          QT -= core gui

          TARGET = myCore
          TEMPLATE = lib
          CONFIG += staticlib
          CONFIG += c++11
          INCLUDEPATH += /opt/local/include

          SOURCES +=
          f1.cpp
          f2.cpp

          HEADERS +=
          f1.h
          f2.h
          unix {
          target.path = /usr/lib
          INSTALLS += target
          }

          myUI.pro

          QT += core gui opengl

          greaterThan(QT_MAJOR_VERSION, 5): QT += widgets

          TARGET = myProject
          TEMPLATE = app
          CONFIG += c++11
          INCLUDEPATH += /opt/local/include
          INCLUDEPATH += ../myCore
          LIBS += -L../myCore -lmyCore

          SOURCES += main.cpp
          f3.cpp
          f4.cpp

          HEADERS +=
          f3.h
          f4.h

          FORMS += mainwindow.ui
          @

          Can someone spot a problem?

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            I am now fairly convinced that my problems happen because the app does not relink when static library is updated. Do I have to specify explicitly a dependency on static library, how?

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              Daah! There is a button in QtCreator context menu to add a library to application. Let's see it it solves the problem.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                apoenitz
                wrote on last edited by
                #7

                Check out http://qt-project.org/doc/qt-5/qmake-variable-reference.html#pre-targetdeps

                And I wouldn't mind if you could change the topic of the thread here.

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  Solved. Qmake is not smart enough to add library dependency by itself, user action is required.
                  @apoenitz - thanks for the link

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved