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. [Solved] Qt, .pro file and platform
Forum Updated to NodeBB v4.3 + New Features

[Solved] Qt, .pro file and platform

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 4.0k Views 1 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.
  • mrdebugM Offline
    mrdebugM Offline
    mrdebug
    wrote on last edited by
    #1

    I have to include a lib only in I compile the program on Arm. How can I do?
    Something like this:

    unix:__arm__ {
        LIBS += ../../raspicam-0.1.1/build/src/libraspicam.so
    }
    

    but does not work.

    Need programmers to hire?
    www.labcsp.com
    www.denisgottardello.it
    GMT+1
    Skype: mrdebug

    1 Reply Last reply
    0
    • A Offline
      A Offline
      ankursaxena
      wrote on last edited by
      #2

      R u using qt creator ??

      If u r using qt creator, then add library by right click on project and select the Add Library.. . I think it is some how easy way.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dev-TThanner
        wrote on last edited by
        #3

        Hi mrdebug,

        we are doing similar things here, too. And they do work. So there might be two issues with your .pro file:

        1. Are you sure "unix:arm" ist the correct expression for that platform? To check you can add a message statement like this:

        @unix:arm {
        message(unix_arm reached)
        LIBS += ../../raspicam-0.1.1/build/src/libraspicam.so
        }@

        Then run qmake and take a look at the ouput.

        1. When using a Unix environment, you should add a "-L" before the library name and omit the "lib" and ".so" part of the library name. Looks like qmake translates the "LIBS" variable very directly into gcc command lines.
          So maybe this works for you:

        @unix:arm {
        message(unix_arm reached)
        LIBS += -L../../raspicam-0.1.1/build/src/raspicam
        }@

        /thomas

        1 Reply Last reply
        0
        • mrdebugM Offline
          mrdebugM Offline
          mrdebug
          wrote on last edited by
          #4

          I want the same .pro file for both i386 and arm. But only on arm I have to include the libraspicam.
          I have tried

          @unix {

          unix:arm {
              LIBS += ../../raspicam-0.1.1/build/src/libraspicam.so
          }
          

          }
          @

          but does not work. If I compile the app in i386 (Linux) the compiler wants the libraspicam.

          Need programmers to hire?
          www.labcsp.com
          www.denisgottardello.it
          GMT+1
          Skype: mrdebug

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

            Hi,

            From the top of my head it should be something like:

            @linux-arm-gnueabi-g++:message(using arm)@

            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
            • mrdebugM Offline
              mrdebugM Offline
              mrdebug
              wrote on last edited by
              #6

              Solved with
              @unix {

              message(using arm) {
                  LIBS += ../../raspicam-0.1.1/build/src/libraspicam.so
              }
              

              }@

              Need programmers to hire?
              www.labcsp.com
              www.denisgottardello.it
              GMT+1
              Skype: mrdebug

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

                That might work if you are on windows otherwise it won't

                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
                • mrdebugM Offline
                  mrdebugM Offline
                  mrdebug
                  wrote on last edited by
                  #8

                  According to
                  http://qt-project.org/doc/qt-4.8/qmake-function-reference.html#contains-variablename-value

                  @ exists(../../raspicam-0.1.1/build/src/libraspicam.so) {
                  message(../../raspicam-0.1.1/build/src/libraspicam.so exists)
                  LIBS += ../../raspicam-0.1.1/build/src/libraspicam.so
                  } else {
                  message(Not exists)
                  }

                  message(Platform: $$QMAKE_HOST.arch)@
                  

                  Need programmers to hire?
                  www.labcsp.com
                  www.denisgottardello.it
                  GMT+1
                  Skype: mrdebug

                  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