Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [SOLVED] debug and release CONFIG options and .pro file
QtWS25 Last Chance

[SOLVED] debug and release CONFIG options and .pro file

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 2.5k 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.
  • E Offline
    E Offline
    Eonz
    wrote on last edited by
    #1

    In my project's build steps the qmake call is configured with "CONFIG+=debug" when Debug configuration is selected.

    Is this addition of debug applicable when the .pro file is parsed? I had assumed that this is the primary purpose, so that the .pro file can be set to do different things when using Debug or Release configurations by checking

    @CONFIG(debug)@

    for example. For some reason though these

    @CONFIG()@

    functions don't work correctly. Specifically when adding libraries.

    The following behaves differently with Debug configuration selected:

    @
    CONFIG(debug): LIBS += -L../build-MyLibrary-Desktop_Qt_5_0_2_MinGW_32bit/debug/ -lMyLibrary
    CONFIG(release): LIBS += -L../build-MyLibrary-Desktop_Qt_5_0_2_MinGW_32bit/release/ -lMyLibrary
    @

    to when I simply say this:

    @
    LIBS += -L../build-MyLibrary-Desktop_Qt_5_0_2_MinGW_32bit/debug/ -lMyLibrary
    @

    Both compile, but when running the application the latter works, the former doesn't. I would have thought both would work. I did do multiple cleans and qmakes and things to make sure.

    I'm using Qt Creator 2.7.0 based on Qt 5.0.2 win MinGW on Windows 7.

    Edit: I should add that the library creates TCP server and client sockets. The symptom of "not working" is that the client can't connect to the locally hosted server on 127.0.0.1. Windows firewall does ask me if I want to add a rule and I do so. This may be firewall related, but still, there should be NO difference between the two ways of configuring exactly the same thing, right?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      One correct test example:

      @CONFIG(release, debug|release) {
      #do what your need when building in release
      }
      @

      As for your network question, you should rather create a new thread with it

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Eonz
        wrote on last edited by
        #3

        Thanks, the addition of

        @debug|release@

        in both cases did the trick. The network discussion wasn't a new question but rather expanding on the symptoms. But it works now, so I consider this solved :)

        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