Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Cannot Find -l<LibName>, with older compiler
Forum Updated to NodeBB v4.3 + New Features

Cannot Find -l<LibName>, with older compiler

Scheduled Pinned Locked Moved Solved Installation and Deployment
12 Posts 3 Posters 2.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.
  • RyanRR RyanR

    Hey Guys,
    I've been struggling with compiling a library on a newer compiler with QT-Creator.

    The program runs and compiles fine on my QT-5.5.1 GCC 32 bit :
    qmake DIRECTORY_TO_PROJECT/PROJECT_NAME.pro -r -spec linux-g++-32 CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug

    But when I try and compile it using QT-5.6.2 :
    qmake DIRECTORY_TO_PROJECT/PROJECT_NAME.pro -r -spec devices/linux-imx6-g++ CONFIG+=debug

    It throws "cannot find -lqwt"

    I've spent countless hours searching every corner of the forums without being able to find a clear answer to my problem.

    I have made sure to add the following to my .pro:
    LIBS += -lqwt
    CONFIG += qwt
    INCLUDEPATH += PATH_TO_LIBS/include

    And like I had said before, with these included, it runs no problem using the different compiler. However when I add
    LIBS += -l /usr/local/qwt-6.1.3/lib/libqwt.so
    It throws one additional error of:
    "cannot find /usr/local/qwt-6.1.3/lib/libqwt.so"
    And it is most certainly there
    I was thinking that maybe it's because I'm mistakenly trying to use a combination of 64/32 bit libraries, but I don't know that for sure.

    Any insight of what else I should check would be greatly appreciated!

    aha_1980A Offline
    aha_1980A Offline
    aha_1980
    Lifetime Qt Champion
    wrote on last edited by aha_1980
    #2

    Hi @RyanR,

    LIBS += -l /usr/local/qwt-6.1.3/lib/libqwt.so
    "cannot find /usr/local/qwt-6.1.3/lib/libqwt.so"

    What happens if you change this to (the correct format):

    LIBS += -L/usr/local/qwt-6.1.3/lib -lqwt

    Also, make sure libqwt.so is in the given path (at least as a symlink).

    I was thinking that maybe it's because I'm mistakenly trying to use a combination of 64/32 bit libraries, but I don't know that for sure.

    You can check this with the file command:

    file /usr/local/qwt-6.1.3/lib/libqwt.so (if that is a symlink, resolve it until you hit the library)

    Regards.

    Qt has to stay free or it will die.

    1 Reply Last reply
    2
    • RyanRR Offline
      RyanRR Offline
      RyanR
      wrote on last edited by
      #3

      @aha_1980 said in Cannot Find -l<LibName>, with older compiler:

      LIBS += -L/usr/local/qwt-6.1.3/lib -lqwt

      I've given this a shot and it spits out:
      skipping incompatible /usr/local/qwt-6.1.3/lib//libqwt.so when searching for -lqwt
      cannot find -lqwt

      This is what led me top believe that maybe there was a mix up with 32 and 64 bit library/compilers, so I've checked the files, and you were correct that it is a symlink to libqwt.so.1.6.3, so I ran "file" on it that, and it returned with:
      ELF 32-bit LSB shared object, ...

      So although this hasn't really solved my issue, it's a step in the right direction.

      Could it be something that I may have missed with the qmake? I just don't fully understand how one compiler can have no issues locating and reading the .so files, where is seems to fail with another

      Thanks for the feedback!

      1 Reply Last reply
      0
      • RyanRR Offline
        RyanRR Offline
        RyanR
        wrote on last edited by
        #4

        I should also add that it is failing I am using the ARM-GCC compiler, I do not currently have the Qt mkspec set, and this is with QT-version 5.6.2

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

          Hi and welcome to devnet,

          Do you have all libraries cross-compiled for your target ?

          From the looks of it, you might be trying to link an x86 version of the library.

          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
          2
          • RyanRR Offline
            RyanRR Offline
            RyanR
            wrote on last edited by
            #6

            No I don't believe I've done that!

            I was reading that I can use buildroot or something similar to it, and that should do it for me?
            Do you have any other recommendations for what can be used to crosscompile for ARM with Linux?

            I'll give that a try either way! Thanks

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

              You also have the yocto project that can help you.

              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
              1
              • RyanRR Offline
                RyanRR Offline
                RyanR
                wrote on last edited by
                #8

                I appreciate the help, but I'm still struggling to get it to compile properly.

                I've been reading up on cross-compiling, and it seems that is definitely my issue, but the process of how to do it remains unclear to me.

                Would you spell out the necessary steps of what is required in order to cross-compile a library, as I am concerned I might have missed an important step or 2 along the way that could be giving me grief.

                Thanks

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

                  What development process are you going to follow ? Building a Yocto image ? Cross-compile Qt for your target using its root filesystem to get all needed dependencies ?

                  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
                  • RyanRR Offline
                    RyanRR Offline
                    RyanR
                    wrote on last edited by
                    #10

                    To be honest, I'm not even sure what different options I may have which I could follow.

                    Ideally I would like to keep it all on it's root filesystem, as that seems to be the most straight forward option that I've come across so far.

                    Just to be sure I'm fully understanding what I'm in the process of resolving, essentially my problem is that I have this 32 bit library (QWT) that needs to be cross-compiled to run on my ARM Target? and the reason that it was compiling and running fine on the Host side is due to the fact that it's Native-Compiling and therefore didn't have to convert from GCC-ARM? Is that correct?

                    I appreciate you bearing with me while I try and familiarize myself with these concepts

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

                      IIRC, when building Qwt you have to give it the path to the Qt version you want to use to build it. In that case, point that option to the qmake of your already cross-compiled Qt and you should be good to go.

                      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
                      2
                      • RyanRR Offline
                        RyanRR Offline
                        RyanR
                        wrote on last edited by
                        #12

                        Yup! That Worked!

                        I just had to delete the QWT folders in my /usr/local/ and /home/ Directories, download a fresh copy of qwt-6.1.3, and rebuild it using the qmake from the cross-compiler (in /usr/local/Qt-X.X.X-/bin/qmake) I was trying to use, and that did the trick!

                        Thanks so much for the help!

                        1 Reply Last reply
                        1

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved