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. Link a dynamic library
Forum Updated to NodeBB v4.3 + New Features

Link a dynamic library

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 5 Posters 770 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.
  • R Offline
    R Offline
    Rouja
    wrote on last edited by
    #1

    Hello,

    I created a .so library from a cpp file.
    I want to use this library in the my project. I added in the INCLUDEPATH+= the path of the header of the created library. And I added the library path in LIBS+=
    But, I am getting an error that indicates that the function used in library is not defined in the generated library of my project.
    The error says: undefined reference to "my function" in the lib of my project.

    Can aanyone help me, I would like to know what did I miss?

    VRoninV 1 Reply Last reply
    0
    • R Rouja

      Hello,

      I created a .so library from a cpp file.
      I want to use this library in the my project. I added in the INCLUDEPATH+= the path of the header of the created library. And I added the library path in LIBS+=
      But, I am getting an error that indicates that the function used in library is not defined in the generated library of my project.
      The error says: undefined reference to "my function" in the lib of my project.

      Can aanyone help me, I would like to know what did I miss?

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

      @Rouja said in Link a dynamic library:

      And I added the library path in LIBS+=

      Can you show the code for this part? My guess is that you forgot the -lmylibrary part

      "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
      3
      • R Offline
        R Offline
        Rouja
        wrote on last edited by
        #3

        yes I fogot that. It compiles correctly now.
        But, I have another problem. In fact, I install all the libraries in my hardware. It doesn't work and it dosn't recognize my library whil excution.

        jsulmJ W 2 Replies Last reply
        0
        • R Rouja

          yes I fogot that. It compiles correctly now.
          But, I have another problem. In fact, I install all the libraries in my hardware. It doesn't work and it dosn't recognize my library whil excution.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Rouja said in Link a dynamic library:

          I install all the libraries in my hardware. It doesn't work and it dosn't recognize my library whil excution

          You have to give more information.
          Where do you install these libraries exactly?
          Are these libraries build for your target hardware?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • R Offline
            R Offline
            Rouja
            wrote on last edited by Rouja
            #5

            Yes all the libraries are build for the target hardware.
            An error appeas that says: undefined symbol

            jsulmJ 1 Reply Last reply
            0
            • R Rouja

              Yes all the libraries are build for the target hardware.
              An error appeas that says: undefined symbol

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Rouja Where do you install these libraries exactly?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • R Offline
                R Offline
                Rouja
                wrote on last edited by
                #7

                Hardware card. My question is that the library .so have to be treated differently while excution?

                Pablo J. RoginaP jsulmJ 2 Replies Last reply
                0
                • R Rouja

                  Hardware card. My question is that the library .so have to be treated differently while excution?

                  Pablo J. RoginaP Offline
                  Pablo J. RoginaP Offline
                  Pablo J. Rogina
                  wrote on last edited by
                  #8

                  @Rouja what's the output of the following command in your hardware:

                  ldd /path/to/your/Qt_application
                  

                  Upvote the answer(s) that helped you solve the issue
                  Use "Topic Tools" button to mark your post as Solved
                  Add screenshots via postimage.org
                  Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                  1 Reply Last reply
                  2
                  • R Rouja

                    yes I fogot that. It compiles correctly now.
                    But, I have another problem. In fact, I install all the libraries in my hardware. It doesn't work and it dosn't recognize my library whil excution.

                    W Offline
                    W Offline
                    wrosecrans
                    wrote on last edited by
                    #9

                    @Rouja said in Link a dynamic library:

                    But, I have another problem. In fact, I install all the libraries in my hardware. It doesn't work and it dosn't recognize my library whil excution.

                    If you are getting an error message, please do not keep that message secret from people who are willing to try to help you. The standard format of working a bug is

                    1 I did X
                    2 I expected Y
                    3 But Z happened.

                    You haven't shared what you actually did. (What hardware? How did you install?) Or what happened. (A particular error message? Is it a dynamic linker error that prevents the program for starting, or a dlopen error that occurs immediately after startup?) If you can take a moment to provide that kind of info when you ask for help online, you make it much easier for people to help you.

                    1 Reply Last reply
                    4
                    • R Rouja

                      Hardware card. My question is that the library .so have to be treated differently while excution?

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @Rouja said in Link a dynamic library:

                      Hardware card

                      Can you please tell us where exactly on your card?!
                      In /usr/lib/ or somewhere else?

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      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