Ubuntu系统上使用QtCreator调试BNC

Ubuntu系统上使用QtCreator调试BNC

在Ubuntu系统上调试BNC 2.12.13

前言

  此前未曾接触过QT,本文主要是记录使用QT以及QtCreator对BNC(BKG NTRIP Client) 2.12.13的调试。

版本说明

  • Ubuntu: Ubuntu 18.04.4 LTS
  • QT:   Qt-4.8.7
  • QtCreator:qt-creator-opensource-linux-x86_64-4.1.0
  • BNC:  2.12.13

调试配置

  • 1
      首先,使用QtCreator打开BNC 2.12.13源码文件夹下的bnc.pro,并按照Debug模式设置项目,具体设置见下图:
    Ubuntu系统上使用QtCreator调试BNC
      从而该工程文件便被加载进了QtCreator中,加载后的页面如下所示:
    Ubuntu系统上使用QtCreator调试BNC
  • 2
      但此时若直接进行程序编译----调试,程序无法进行正常调试,且会有如下的警告:

This does not seem to be a “Debug” build.
Setting breakpoints by file name and line number may fail.
Section .debug_info: Not found.
Section .debug_abbrev: Not found.
Section .debug_line: Not found.
Section .debug_str: Not found.
Section .debug_loc: Not found.
Section .debug_range: Not found.
Section .gdb_index: Not found.
Section .note.gnu.build-id: Found.
Section .gnu.hash: Found.
Section .gnu_debuglink: Not found.

Ubuntu系统上使用QtCreator调试BNC
  发生这个警告后需要把src.pro中的内容更换为

TARGET = …/bnc
#CONFIG -= debug
#CONFIG += release
CONFIG += debug_and_release
include(src.pri)
HEADERS += app.h
SOURCES += bncmain.cpp app.cpp

  从而能够有效解决上述警告。

  • 3
      在项目----运行----运行设置----Command line arguments中输入 --nw,勾选Run in terminal即可在无窗口下终端中进行调试。
    Ubuntu系统上使用QtCreator调试BNC

参考文献