Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved How can i import LIBS

    General and Desktop
    2
    11
    285
    Loading More Posts
    • 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.
    • Yaldiz
      Yaldiz last edited by Yaldiz

      HI,

      I am using SDK's library (#include "libsoc_gpio.h")

      And I also added theese to the .pro file;

      QMAKE_CXXFLAGS += -lpthread
      LIBS +=-lpthread

      LIBS += -llibsoc_gpio

      But when i compile the code it's gives theese errors;

      1-) :-1: error: collect2: error: ld returned 1 exit status
      2-) :-1: error: [Makefile:653: LCD-SubMenus] Error 1

      NOTE: library path: /opt/tdx-xwayland/5.6.0/sysroots/armv7at2hf-neon-tdx-linux-gnueabi/usr/include

      How can i use this?

      Best regards.

      KroMignon 1 Reply Last reply Reply Quote 0
      • KroMignon
        KroMignon @Yaldiz last edited by

        @Yaldiz AFAIK, for Linux system, you should remove "lib" for the library name.
        You can specify library path with -L

        To summarize the correct way should be:

        LIBS += -L/opt/tdx-xwayland/5.6.0/sysroots/armv7at2hf-neon-tdx-linux-gnueabi/usr/include -lsoc_gpio
        

        It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

        1 Reply Last reply Reply Quote 1
        • Yaldiz
          Yaldiz last edited by

          I tried for sqlite like below and it's works fine;

          LIBS += -L/opt/tdx-xwayland/5.6.0/sysroots/armv7at2hf-neon-tdx-linux-gnueabi/usr/include -lsqlite3

          but when i try for libsoc_gpio it's gives same error.
          I think there is another problem. What could be this problem?

          KroMignon 1 Reply Last reply Reply Quote 0
          • KroMignon
            KroMignon @Yaldiz last edited by

            @Yaldiz said in How can i import LIBS:

            /opt/tdx-xwayland/5.6.0/sysroots/armv7at2hf-neon-tdx-linux-gnueabi/usr/include

            Are you really sure /opt/tdx-xwayland/5.6.0/sysroots/armv7at2hf-neon-tdx-linux-gnueabi/usr/include contains the library file libsoc_gpio.so?

            It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

            1 Reply Last reply Reply Quote 0
            • Yaldiz
              Yaldiz last edited by

              Yes, exist libsoc_gpio.h

              huseyin@X-X:/opt/tdx-xwayland/5.6.0/sysroots/armv7at2hf-neon-tdx-linux-gnueabi/usr/include$ ls libsoc
              libsoc_board.h libsoc_debug.h libsoc_i2c.h libsoc_pwm.h
              libsoc_conffile.h libsoc_gpio.h libsocketcan.h libsoc_spi.h

              KroMignon 1 Reply Last reply Reply Quote 0
              • KroMignon
                KroMignon @Yaldiz last edited by KroMignon

                @Yaldiz said in How can i import LIBS:

                Yes, exist libsoc_gpio.h

                This is the header file not the library which you want to link with.
                The library will have .so (for dynamic library) or .a (for static library) as extension.

                try this to find its location: find opt/tdx-xwayland/5.6.0/sysroots/armv7at2hf-neon-tdx-linux-gnueabi/ -name libsoc_gpio.*

                It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                1 Reply Last reply Reply Quote 0
                • Yaldiz
                  Yaldiz last edited by

                  @KroMignon said in How can i import LIBS:

                  libsoc_gpio.so

                  No .so or .a file.

                  KroMignon 1 Reply Last reply Reply Quote 0
                  • KroMignon
                    KroMignon @Yaldiz last edited by

                    @Yaldiz said in How can i import LIBS:

                    No .so or .a file.

                    Did you try the search it with:
                    find /opt/tdx-xwayland/5.6.0/sysroots/armv7at2hf-neon-tdx-linux-gnueabi/ -name libsoc_gpio.*
                    or
                    find /opt/tdx-xwayland/5.6.0/sysroots/ -name libsoc_gpio.*

                    It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                    1 Reply Last reply Reply Quote 0
                    • Yaldiz
                      Yaldiz last edited by

                      I tried 2 option, the .so or .a file does not exist.

                      KroMignon 1 Reply Last reply Reply Quote 0
                      • KroMignon
                        KroMignon @Yaldiz last edited by KroMignon

                        @Yaldiz said in How can i import LIBS:

                        I tried 2 option, the .so or .a file does not exist.

                        How do you want to use a library which you don't have?
                        Check this with your SDK provider.

                        It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                        1 Reply Last reply Reply Quote 1
                        • Yaldiz
                          Yaldiz last edited by

                          Thank you very much for your time and help, I will ask my SDK provider.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post