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 all libraries into the executable (actually: make a deploy folder)
Forum Updated to NodeBB v4.3 + New Features

Link all libraries into the executable (actually: make a deploy folder)

Scheduled Pinned Locked Moved General and Desktop
27 Posts 5 Posters 11.1k 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.
  • kshegunovK kshegunov

    @asanka424

    if you have all your so files in same directory as your executable, it will find those libraries.

    On Windows, yes, but not on Linux. You have to explicitly point the loader to the current working directory.

    A Offline
    A Offline
    asanka424
    wrote on last edited by
    #21

    @kshegunov I thought . is default added into rpath. Yes that is build chain specific thing and should not consider as a global thing.

    kshegunovK 1 Reply Last reply
    0
    • P Offline
      P Offline
      Pippin
      wrote on last edited by
      #22

      @kshegunov Thanks for taking the time to break it down for me, I appreciate it. So I'll try to sort the .so file list I made earlier:

      These files should be in my project directory:

      platforms/libqxcb.so
      libsfml-system.so.2.3
      libsfml-network.so.2.3
      libQt5Widgets.so.5
      libQt5Gui.so.5
      libQt5Core.so.5
      

      As well as these files (because of the SFML libraries)

      libfreetype.so.6
      libX11.so.6
      libxcb.so.1
      libX11-xcb.so.1
      libxcb-glx.so.0
      libxcb-dri2.so.0
      libxcb-dri3.so.0
      libxcb-present.so.0
      libxcb-sync.so.1
      libGL.so.1
      libpthread.so.0
      

      As well as these files (because of the Qt libraries)

      libicudata.so.55
      libicui18n.so.55
      libicuuc.so.55
      

      And these files should not be included in my project directory:

      libstdc++.so.6
      libm.so.6
      libgcc_s.so.1
      libc.so.6
      librt.so.1
      libgobject-2.0.so.0
      libglib-2.0.so.0
      libgobject-2.0.so.0
      libpng12.so.0
      libharfbuzz.so.0
      libz.so.1
      libpcre16.so.3
      libdl.so.2
      libffi.so.6
      libpcre.so.3
      libgraphite2.so.3
      libexpat.so.1
      libglapi.so.0
      libXext.so.6
      libXdamage.so.1
      libXfixes.so.3
      libxshmfence.so.1
      libXxf86vm.so.1
      libdrm.so.2
      libXau.so.6
      libXdmcp.so.6
      

      Did I get something wrong in any list? Anyway, I tried that and compiled my project successfully. When I run it however, I still get the old openGL message:

      ./my_app: symbol lookup error: /home/lol/Documents/Coding/Union/libQt5Gui.so.5: undefined symbol: glGetString
      

      which I never had before I started to mess with .so files. I'm not sure how to determine which .so file is needed for glGetString.

      1 Reply Last reply
      0
      • A asanka424

        @kshegunov I thought . is default added into rpath. Yes that is build chain specific thing and should not consider as a global thing.

        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by
        #23

        @asanka424

        is default added into rpath. Yes that is build chain specific thing and should not consider as a global thing.

        Nope, by default rpath is not set.

        @Pippin

        Leave those to the system (don't copy them with your executable):

        • libfreetype - a fonts library
        • libX11* - X11 libraries
        • libxcb* - more X11 libraries
        • libGL - OpenGL library
        • libpthread - thread support

        Copy libQt* (those that you need, and you seem to have done that) and libic* + the platform plugin (I also see it in your project folder).

        I'm not sure how to determine which .so file is needed for glGetString.

        This would be libGL.so, however if it's installed on your system it should be known to the loader. One thing that might be interfering with that would be some binary incompatibility - either a different compiler was used (unlikely to cause a problem) or a very different version of the library. Did you make sure you have libGL installed on your system?

        Kind regards.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Pippin
          wrote on last edited by Pippin
          #24

          Well I googled the issue, I added -lGL -lstdc++ -lc -lm -lglut -lGLU to LIBS in the .pro file but I still get the error. I really don't know what's happening here :S

          libgl1-mesa-dev is already the newest version.
          
          kshegunovK A 2 Replies Last reply
          0
          • P Pippin

            Well I googled the issue, I added -lGL -lstdc++ -lc -lm -lglut -lGLU to LIBS in the .pro file but I still get the error. I really don't know what's happening here :S

            libgl1-mesa-dev is already the newest version.
            
            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by kshegunov
            #25

            @Pippin
            Could you run ld --verbose | grep SEARCH_DIR | tr -s ' ;' \\012 on the command line and paste what it returns? Additionally what does ldd libQt5Gui.so when you run it on your deployment folder's library?

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            0
            • hskoglundH Offline
              hskoglundH Offline
              hskoglund
              wrote on last edited by
              #26

              Hi, just a guess, but you could also try changing the order of the -l files, now you have
              -lGL -lstdc++ -lc -lm -lglut -lGLU
              try change to
              -lstdc++ -lc -lm -lglut -lGLU -lGL

              1 Reply Last reply
              0
              • P Pippin

                Well I googled the issue, I added -lGL -lstdc++ -lc -lm -lglut -lGLU to LIBS in the .pro file but I still get the error. I really don't know what's happening here :S

                libgl1-mesa-dev is already the newest version.
                
                A Offline
                A Offline
                asanka424
                wrote on last edited by
                #27

                @Pippin is this a GUI or a command line app?

                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