How to compile with -ggdb3
-
wrote on 22 Sept 2024, 03:21 last edited by
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?
-
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?
wrote on 22 Sept 2024, 04:21 last edited by ChrisW67First 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. -
-
wrote on 22 Sept 2024, 05:44 last edited by
Thx, that's worked - I'll go without the gdb/3 stuff
1/3