Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to compile with -ggdb3
Forum Updated to NodeBB v4.3 + New Features

How to compile with -ggdb3

Scheduled Pinned Locked Moved Solved General and Desktop
compilegdb
3 Posts 2 Posters 401 Views
  • 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.
  • G Offline
    G Offline
    gone_bush
    wrote on 22 Sept 2024, 03:21 last edited by
    #1

    I have a Qt application that runs on a headless Raspberry Pi. The build environment was built via:

    cd <project_dir> mkdir build cd build /usr/lib/qt6/bin/qt-cmake ../src/

    and I compile with

    cmake -build . -j 4

    Q: How can I compile it with gdb fully enabled, ie, with -ggdb3?

    C 1 Reply Last reply 22 Sept 2024, 04:21
    0
    • G gone_bush
      22 Sept 2024, 03:21

      I have a Qt application that runs on a headless Raspberry Pi. The build environment was built via:

      cd <project_dir> mkdir build cd build /usr/lib/qt6/bin/qt-cmake ../src/

      and I compile with

      cmake -build . -j 4

      Q: How can I compile it with gdb fully enabled, ie, with -ggdb3?

      C Offline
      C Offline
      ChrisW67
      wrote on 22 Sept 2024, 04:21 last edited by ChrisW67
      #2

      First step is to make debug build:

      /usr/lib/qt6/bin/qt-cmake -DCMAKE_BUILD_TYPE=Debug ../src/
      

      If you are using a GCC tool chain then this will build your executables with debug symbols that gdb can work with using the -g option:

      make VERBOSE=1
      ...
      /usr/bin/c++ -g ...
      
      

      If you must force the -ggdb optionor the -gn variations then you'll likely have to do that that manually in the CFLAGS and CXXFLAGS.

      1 Reply Last reply
      1
      • G gone_bush has marked this topic as solved on 22 Sept 2024, 05:43
      • G Offline
        G Offline
        gone_bush
        wrote on 22 Sept 2024, 05:44 last edited by
        #3

        Thx, that's worked - I'll go without the gdb/3 stuff

        1 Reply Last reply
        0

        1/3

        22 Sept 2024, 03:21

        • Login

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