windows下qt生成release和pdb文件

发布于:2025-07-04 ⋅ 阅读:(15) ⋅ 点赞:(0)

windows下qt生成release程序,且生成 pdb文件,

需要添加CONFIG += force-debug-info

Build Configurations

You can build Qt libraries and tools in various variants, each of them optimized for a different use case.

Debug and Release Builds

-release tells the compiler to optimize the code, and not provide additional debug symbols alongside Qt and its tools.

-debug skips some optimizations to make it easier to debug Qt and its tools. This option also enables the generation of debug symbols that let you inspect the code and state of the built libraries in a debugger.

Finally, -debug-and-release lets you build both a debug and release variant of Qt libraries in one go. This is only supported if you configure a build for Windows.

There are further options to tweak the configurations:

  • -force-debug-info: Creates a release build with debug information.
  • -separate-debug-info: Extracts the debug information into a separate file.
  • -optimize-size: Optimizes release builds for size instead of speed.

Static and Shared Builds

Qt Modules can be built as separate libraries that an executable links to and loads at start time (for Qt libraries), or runtime (for Qt plugins). This is called a shared build and is the default configuration on most platforms. The matching configure option is -shared.

You can also build Qt such that an executable binary will include all Qt modules it links to and all Qt plugins it needs. This is called a static build and can be selected when configuring with the -static option.