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. Better way to strip user specified strings from the final binary
Qt 6.11 is out! See what's new in the release blog

Better way to strip user specified strings from the final binary

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 535 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.
  • J Offline
    J Offline
    johndummy
    wrote on last edited by
    #1

    I want to strip all text strings (which I mostly use for debugging) from my final binary.
    One way I could do is to use #if defined in every line where i use qDebug/cout/cerr but it will clutter the code.

    Is their a clean & easy way to achieve the same goal ?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on last edited by
      #2

      For qDebug,

      qDebug(), qInfo(), and qWarning() are debugging tools. They can be compiled away by defining QT_NO_DEBUG_OUTPUT, QT_NO_INFO_OUTPUT, or QT_NO_WARNING_OUTPUT during compilation.

      1 Reply Last reply
      4
      • D Offline
        D Offline
        DerReisende
        wrote on last edited by
        #3

        Or - slightly more complex for qDebug() etc: Define your own message handler which does nothing in a release build.

        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