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. Problems with .pro file some help?

Problems with .pro file some help?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 1.7k Views 2 Watching
  • 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.
  • stampS Offline
    stampS Offline
    stamp
    wrote on last edited by
    #1

    Hello,
    so here is the problem:
    i have an application in which i am creating a dll with .cpp and .h files and a dllmain.cpp file i have a .pro file and
    a .pri file. in the pri file i include the mentioned above two .cpp and .h files. also i am workin with QT 5.4 and qt Creator.
    In the dll iam using a third party library that needs to be included in the dll so it can work. the question is how to do it in the pro file also i need to somehow determen wheter or not to use the 64 bit or 32 bit version of the dll so i need some kind of macros in the pro file to check it in run time or compile time if its 32 or 64 bit. so this is the second problem. I would appreciate if you give me an examples how to do it and dont give me links to the documantation i have searched a lot.
    thanks in advance.

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

      hi and welcome
      You mean something like ?

      CONFIG += 32bit

      CONFIG(32bit) {
      TARGET = 32bit_binary
      LIBS += -L<path to 32bit libraries>
      }
      CONFIG(64bit) {
      TARGET = 64bit_binary
      LIBS += -L<path to 64bit libraries>
      }

      1 Reply Last reply
      0
      • VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by VRonin
        #3

        I think the correct way is

        contains(QMAKE_TARGET.arch, x86_64){
           # it's 64 bit
        }
        else{
           # it's 32 bit
        }
        

        This goes in the .pro file

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        Paul ColbyP 1 Reply Last reply
        3
        • VRoninV VRonin

          I think the correct way is

          contains(QMAKE_TARGET.arch, x86_64){
             # it's 64 bit
          }
          else{
             # it's 32 bit
          }
          

          This goes in the .pro file

          Paul ColbyP Offline
          Paul ColbyP Offline
          Paul Colby
          wrote on last edited by
          #4

          @VRonin said in Problems with .pro file some help?:

          I think the correct way is ... QMAKE_TARGET ...

          The qmake manual show's something very similar, but using QMAKE_HOST instead:

          win32-g++:contains(QMAKE_HOST.arch, x86_64):{
              message("Host is 64bit")
              ...
          }
          

          In this case, @stamp would probably want to drop the win32-g++ condition (if he's using msvc).

          Cheers.

          VRoninV 1 Reply Last reply
          1
          • stampS Offline
            stampS Offline
            stamp
            wrote on last edited by
            #5

            Thanks a lot for the response ill try them and fill you in how i did it and how it worked.

            1 Reply Last reply
            0
            • Paul ColbyP Paul Colby

              @VRonin said in Problems with .pro file some help?:

              I think the correct way is ... QMAKE_TARGET ...

              The qmake manual show's something very similar, but using QMAKE_HOST instead:

              win32-g++:contains(QMAKE_HOST.arch, x86_64):{
                  message("Host is 64bit")
                  ...
              }
              

              In this case, @stamp would probably want to drop the win32-g++ condition (if he's using msvc).

              Cheers.

              VRoninV Offline
              VRoninV Offline
              VRonin
              wrote on last edited by
              #6

              @Paul-Colby said in Problems with .pro file some help?:

              The qmake manual show's something very similar, but using QMAKE_HOST instead:

              win32-g++:contains(QMAKE_HOST.arch, x86_64):{
                  message("Host is 64bit")
                  ...
              }
              

              That won't work if you are cross compiling, see https://bugreports.qt.io/browse/QTBUG-9160 I still think QMAKE_TARGET is better

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              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