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. Dll/So: how to work
Forum Updated to NodeBB v4.3 + New Features

Dll/So: how to work

Scheduled Pinned Locked Moved Solved General and Desktop
15 Posts 5 Posters 1.4k Views 3 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.
  • sitesvS Offline
    sitesvS Offline
    sitesv
    wrote on last edited by
    #1

    Hello!
    Is it cross-platform method of working with dll/so libraries?
    Would it work with static linking?

    Thank you!

    JonBJ jsulmJ 2 Replies Last reply
    0
    • sitesvS sitesv

      Hello!
      Is it cross-platform method of working with dll/so libraries?
      Would it work with static linking?

      Thank you!

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @sitesv
      What is your question? .dll files are for Windows, .so are for Linux. Static linking might require a different licence from the standard LGPL. And if you mean would that magically somehow work with same executable/binary across platforms, no it would not. You have to compile/link separately for each target platform. But maybe your question is something else....

      1 Reply Last reply
      2
      • sitesvS sitesv

        Hello!
        Is it cross-platform method of working with dll/so libraries?
        Would it work with static linking?

        Thank you!

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

        @sitesv Shared/static libs do not have anything to do with cross platform development. You anyway have to build for each platform you want to support, doesn't mater whether you use shared/static libs.

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

        1 Reply Last reply
        2
        • sitesvS Offline
          sitesvS Offline
          sitesv
          wrote on last edited by
          #4

          I have an app with dll's (windows variant). I need to make this soft for linux.
          I need to recompile the app and libs. How to use dll/so in app code?

          Pl45m4P 1 Reply Last reply
          0
          • sitesvS sitesv

            I have an app with dll's (windows variant). I need to make this soft for linux.
            I need to recompile the app and libs. How to use dll/so in app code?

            Pl45m4P Offline
            Pl45m4P Offline
            Pl45m4
            wrote on last edited by
            #5

            @sitesv

            Do you just have the dll or do you have the code available? You can not convert compiled dll's into so's.


            If debugging is the process of removing software bugs, then programming must be the process of putting them in.

            ~E. W. Dijkstra

            sitesvS 1 Reply Last reply
            0
            • Pl45m4P Pl45m4

              @sitesv

              Do you just have the dll or do you have the code available? You can not convert compiled dll's into so's.

              sitesvS Offline
              sitesvS Offline
              sitesv
              wrote on last edited by sitesv
              #6

              @Pl45m4
              I have dll's sources.
              I know about function names.
              I need to know about something like LoadLibrary and GetProcAddress, that will work with *.so in Linux as well.

              jsulmJ 1 Reply Last reply
              0
              • sitesvS sitesv

                @Pl45m4
                I have dll's sources.
                I know about function names.
                I need to know about something like LoadLibrary and GetProcAddress, that will work with *.so in Linux as well.

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

                @sitesv said in Dll/So: how to work:

                I need to know about something like LoadLibrary and GetProcAddress

                Usually there is no need for that if you link against shared libraries. LoadLibrary and GetProcAddress is only needed if you're loading shared libs manually at runtime. If you're just linking against shared libraries then you simply include header files from the libs and use their functionality as usual.
                See https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html for some hints.

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

                sitesvS 1 Reply Last reply
                1
                • jsulmJ jsulm

                  @sitesv said in Dll/So: how to work:

                  I need to know about something like LoadLibrary and GetProcAddress

                  Usually there is no need for that if you link against shared libraries. LoadLibrary and GetProcAddress is only needed if you're loading shared libs manually at runtime. If you're just linking against shared libraries then you simply include header files from the libs and use their functionality as usual.
                  See https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html for some hints.

                  sitesvS Offline
                  sitesvS Offline
                  sitesv
                  wrote on last edited by
                  #8

                  @jsulm said in Dll/So: how to work:

                  @sitesv said in Dll/So: how to work:

                  I need to know about something like LoadLibrary and GetProcAddress

                  Usually there is no need for that if you link against shared libraries. LoadLibrary and GetProcAddress is only needed if you're loading shared libs manually at runtime. If you're just linking against shared libraries then you simply include header files from the libs and use their functionality as usual.

                  Sorry, my fault.
                  Exactly, I need to load libs manually at runtime.

                  jsulmJ 1 Reply Last reply
                  0
                  • sitesvS sitesv

                    @jsulm said in Dll/So: how to work:

                    @sitesv said in Dll/So: how to work:

                    I need to know about something like LoadLibrary and GetProcAddress

                    Usually there is no need for that if you link against shared libraries. LoadLibrary and GetProcAddress is only needed if you're loading shared libs manually at runtime. If you're just linking against shared libraries then you simply include header files from the libs and use their functionality as usual.

                    Sorry, my fault.
                    Exactly, I need to load libs manually at runtime.

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

                    @sitesv In this case see https://tldp.org/HOWTO/Program-Library-HOWTO/dl-libraries.html

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

                    sitesvS 1 Reply Last reply
                    2
                    • jsulmJ jsulm

                      @sitesv In this case see https://tldp.org/HOWTO/Program-Library-HOWTO/dl-libraries.html

                      sitesvS Offline
                      sitesvS Offline
                      sitesv
                      wrote on last edited by
                      #10

                      @jsulm Thank you!
                      I was hoping that there are QT functions that allow working with libraries of different systems.

                      JonBJ jsulmJ 2 Replies Last reply
                      0
                      • sitesvS sitesv

                        @jsulm Thank you!
                        I was hoping that there are QT functions that allow working with libraries of different systems.

                        JonBJ Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by
                        #11

                        @sitesv
                        There are not. You need to use the calls suggested by @jsulm .

                        Pablo J. RoginaP 1 Reply Last reply
                        1
                        • JonBJ JonB

                          @sitesv
                          There are not. You need to use the calls suggested by @jsulm .

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

                          @JonB said in Dll/So: how to work:

                          There are not.

                          Is QLibrary of any help here?

                          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

                          JonBJ 1 Reply Last reply
                          5
                          • sitesvS sitesv

                            @jsulm Thank you!
                            I was hoping that there are QT functions that allow working with libraries of different systems.

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

                            @sitesv See reply from @Pablo-J-Rogina

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

                            1 Reply Last reply
                            2
                            • Pablo J. RoginaP Pablo J. Rogina

                              @JonB said in Dll/So: how to work:

                              There are not.

                              Is QLibrary of any help here?

                              JonBJ Offline
                              JonBJ Offline
                              JonB
                              wrote on last edited by
                              #14

                              @Pablo-J-Rogina said in Dll/So: how to work:

                              Is QLibrary of any help here?

                              My apologies! I didn't realize Qt provided an interface. The facts/behaviour remain the same, but Qt obviously supplies a "wrapper" layer.

                              1 Reply Last reply
                              1
                              • sitesvS Offline
                                sitesvS Offline
                                sitesv
                                wrote on last edited by
                                #15

                                Thanks a lot, guys!

                                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