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

HTTP library

Scheduled Pinned Locked Moved Unsolved General and Desktop
29 Posts 5 Posters 2.5k 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.
  • C Offline
    C Offline
    ChrisW67
    wrote on last edited by
    #3

    Typically a library like this would have an install target in its Makefile (that derives from the PRO file). Not the case here.

    The built library is in the qhttp_build_dir/xbin folder.
    The headers needed to compile code to use the library remain in the qhttp/src folder.

    You need to install the resulting library and public headers into a system library or include folder.
    Alternatively, add the folder to your project:

    INCLUDEPATH += /a/path/to/qhttp/src
    LIBS += -L/a/path/to/qhttp_build_dir/xbin -lqhttp
    

    Use absolute paths unless you are certain about relative paths.

    J 1 Reply Last reply
    0
    • jsulmJ jsulm

      @jenya7 said in HTTP library:

      How can I actually include the lib in the project?

      You forgot to tell linker where to find the lib:

      LIBS += -LFOLDER_CONTAINING_THE_LIB -lqhttp
      
      J Offline
      J Offline
      jenya7
      wrote on last edited by
      #4

      @jsulm said in HTTP library:

      @jenya7 said in HTTP library:

      How can I actually include the lib in the project?

      You forgot to tell linker where to find the lib:

      LIBS += -LFOLDER_CONTAINING_THE_LIB -lqhttp
      

      I tried

      INCLUDEPATH += /home/pi/qhttp/xbin
      

      Still can't find it.

      A folder xbin was created home/pi/qhttp/xbin but I see only a shortcut to libqhttp.so in it.

      jsulmJ 1 Reply Last reply
      0
      • J jenya7

        @jsulm said in HTTP library:

        @jenya7 said in HTTP library:

        How can I actually include the lib in the project?

        You forgot to tell linker where to find the lib:

        LIBS += -LFOLDER_CONTAINING_THE_LIB -lqhttp
        

        I tried

        INCLUDEPATH += /home/pi/qhttp/xbin
        

        Still can't find it.

        A folder xbin was created home/pi/qhttp/xbin but I see only a shortcut to libqhttp.so in it.

        jsulmJ Online
        jsulmJ Online
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #5

        @jenya7 Please reread what I wrote, I did not write anything about INCLUDEPATH...

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

        J 1 Reply Last reply
        0
        • C ChrisW67

          Typically a library like this would have an install target in its Makefile (that derives from the PRO file). Not the case here.

          The built library is in the qhttp_build_dir/xbin folder.
          The headers needed to compile code to use the library remain in the qhttp/src folder.

          You need to install the resulting library and public headers into a system library or include folder.
          Alternatively, add the folder to your project:

          INCLUDEPATH += /a/path/to/qhttp/src
          LIBS += -L/a/path/to/qhttp_build_dir/xbin -lqhttp
          

          Use absolute paths unless you are certain about relative paths.

          J Offline
          J Offline
          jenya7
          wrote on last edited by
          #6

          @ChrisW67 said in HTTP library:

          Typically a library like this would have an install target in its Makefile (that derives from the PRO file). Not the case here.

          The built library is in the qhttp_build_dir/xbin folder.
          The headers needed to compile code to use the library remain in the qhttp/src folder.

          You need to install the resulting library and public headers into a system library or include folder.
          Alternatively, add the folder to your project:

          INCLUDEPATH += /a/path/to/qhttp/src
          LIBS += -L/a/path/to/qhttp_build_dir/xbin -lqhttp
          

          Use absolute paths unless you are certain about relative paths.

          thank you. it works.

          1 Reply Last reply
          0
          • jsulmJ jsulm

            @jenya7 Please reread what I wrote, I did not write anything about INCLUDEPATH...

            J Offline
            J Offline
            jenya7
            wrote on last edited by
            #7

            @jsulm said in HTTP library:

            @jenya7 Please reread what I wrote, I did not write anything about INCLUDEPATH...

            I missed -L. :)

            1 Reply Last reply
            0
            • J Offline
              J Offline
              jenya7
              wrote on last edited by jenya7
              #8

              Now it compiles good. But in run time I get

              Starting /home/pi/Projects/build-AgroLogicWidget-Desktop-Debug/AgroLogicWidget...
              /home/pi/Projects/build-AgroLogicWidget-Desktop-Debug/AgroLogicWidget: error while loading shared libraries: libqhttp.so.1: cannot open shared object file: No such file or directory

              /home/pi/Projects/build-AgroLogicWidget-Desktop-Debug/AgroLogicWidget exited with code 127

              JonBJ jsulmJ 2 Replies Last reply
              0
              • J jenya7

                Now it compiles good. But in run time I get

                Starting /home/pi/Projects/build-AgroLogicWidget-Desktop-Debug/AgroLogicWidget...
                /home/pi/Projects/build-AgroLogicWidget-Desktop-Debug/AgroLogicWidget: error while loading shared libraries: libqhttp.so.1: cannot open shared object file: No such file or directory

                /home/pi/Projects/build-AgroLogicWidget-Desktop-Debug/AgroLogicWidget exited with code 127

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

                @jenya7
                So where is your libqhttp.so.1 and how does your application locate it at runtime? And if it can be found, does running ldd on it reveal any missing dependencies?

                J 1 Reply Last reply
                0
                • J jenya7

                  Now it compiles good. But in run time I get

                  Starting /home/pi/Projects/build-AgroLogicWidget-Desktop-Debug/AgroLogicWidget...
                  /home/pi/Projects/build-AgroLogicWidget-Desktop-Debug/AgroLogicWidget: error while loading shared libraries: libqhttp.so.1: cannot open shared object file: No such file or directory

                  /home/pi/Projects/build-AgroLogicWidget-Desktop-Debug/AgroLogicWidget exited with code 127

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

                  @jenya7 said in HTTP library:

                  libqhttp.so.1

                  Copy it into your build folder (/home/pi/Projects/build-AgroLogicWidget-Desktop-Debug).
                  As another solution you can also set LD_LIBRARY_PATH=/home/pi/Projects/build-AgroLogicWidget-Desktop-Debug in your Run configuration in QtCreator.

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

                  J 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @jenya7 said in HTTP library:

                    libqhttp.so.1

                    Copy it into your build folder (/home/pi/Projects/build-AgroLogicWidget-Desktop-Debug).
                    As another solution you can also set LD_LIBRARY_PATH=/home/pi/Projects/build-AgroLogicWidget-Desktop-Debug in your Run configuration in QtCreator.

                    J Offline
                    J Offline
                    jenya7
                    wrote on last edited by
                    #11

                    @jsulm said in HTTP library:

                    @jenya7 said in HTTP library:

                    libqhttp.so.1

                    Copy it into your build folder (/home/pi/Projects/build-AgroLogicWidget-Desktop-Debug).
                    As another solution you can also set LD_LIBRARY_PATH=/home/pi/Projects/build-AgroLogicWidget-Desktop-Debug in your Run configuration in QtCreator.

                    it happens in Debug as well.

                    1 Reply Last reply
                    0
                    • JonBJ JonB

                      @jenya7
                      So where is your libqhttp.so.1 and how does your application locate it at runtime? And if it can be found, does running ldd on it reveal any missing dependencies?

                      J Offline
                      J Offline
                      jenya7
                      wrote on last edited by
                      #12

                      @JonB said in HTTP library:

                      @jenya7
                      So where is your libqhttp.so.1 and how does your application locate it at runtime? And if it can be found, does running ldd on it reveal any missing dependencies?

                      How do we know which one is missing?

                      ldd /home/pi/qhttp/xbin/libqhttp.so.1
                      	linux-vdso.so.1 (0xbef67000)
                      	/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0xb6f16000)
                      	libQt5Network.so.5 => /lib/arm-linux-gnueabihf/libQt5Network.so.5 (0xb6d6a000)
                      	libQt5Core.so.5 => /lib/arm-linux-gnueabihf/libQt5Core.so.5 (0xb68f0000)
                      	libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb68c6000)
                      	libatomic.so.1 => /lib/arm-linux-gnueabihf/libatomic.so.1 (0xb68ad000)
                      	libstdc++.so.6 => /lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6766000)
                      	libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb66e4000)
                      	libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb66b7000)
                      	libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6569000)
                      	libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb653e000)
                      	/lib/ld-linux-armhf.so.3 (0xb6f5c000)
                      	libicui18n.so.63 => /lib/arm-linux-gnueabihf/libicui18n.so.63 (0xb62f0000)
                      	libicuuc.so.63 => /lib/arm-linux-gnueabihf/libicuuc.so.63 (0xb616a000)
                      	libpcre2-16.so.0 => /lib/arm-linux-gnueabihf/libpcre2-16.so.0 (0xb60ee000)
                      	libdouble-conversion.so.1 => /lib/arm-linux-gnueabihf/libdouble-conversion.so.1 (0xb60ca000)
                      	libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb60b7000)
                      	libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0xb5fa7000)
                      	libicudata.so.63 => /lib/arm-linux-gnueabihf/libicudata.so.63 (0xb45a9000)
                      	libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0xb4532000)
                      
                      JonBJ 1 Reply Last reply
                      0
                      • J jenya7

                        @JonB said in HTTP library:

                        @jenya7
                        So where is your libqhttp.so.1 and how does your application locate it at runtime? And if it can be found, does running ldd on it reveal any missing dependencies?

                        How do we know which one is missing?

                        ldd /home/pi/qhttp/xbin/libqhttp.so.1
                        	linux-vdso.so.1 (0xbef67000)
                        	/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0xb6f16000)
                        	libQt5Network.so.5 => /lib/arm-linux-gnueabihf/libQt5Network.so.5 (0xb6d6a000)
                        	libQt5Core.so.5 => /lib/arm-linux-gnueabihf/libQt5Core.so.5 (0xb68f0000)
                        	libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb68c6000)
                        	libatomic.so.1 => /lib/arm-linux-gnueabihf/libatomic.so.1 (0xb68ad000)
                        	libstdc++.so.6 => /lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6766000)
                        	libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb66e4000)
                        	libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb66b7000)
                        	libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6569000)
                        	libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb653e000)
                        	/lib/ld-linux-armhf.so.3 (0xb6f5c000)
                        	libicui18n.so.63 => /lib/arm-linux-gnueabihf/libicui18n.so.63 (0xb62f0000)
                        	libicuuc.so.63 => /lib/arm-linux-gnueabihf/libicuuc.so.63 (0xb616a000)
                        	libpcre2-16.so.0 => /lib/arm-linux-gnueabihf/libpcre2-16.so.0 (0xb60ee000)
                        	libdouble-conversion.so.1 => /lib/arm-linux-gnueabihf/libdouble-conversion.so.1 (0xb60ca000)
                        	libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb60b7000)
                        	libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0xb5fa7000)
                        	libicudata.so.63 => /lib/arm-linux-gnueabihf/libicudata.so.63 (0xb45a9000)
                        	libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0xb4532000)
                        
                        JonBJ Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by JonB
                        #13

                        @jenya7
                        This shows it is not missing any dependencies. So how do you think your application should know to find and load it from /home/pi/qhttp/xbin?

                        J 1 Reply Last reply
                        0
                        • JonBJ JonB

                          @jenya7
                          This shows it is not missing any dependencies. So how do you think your application should know to find and load it from /home/pi/qhttp/xbin?

                          J Offline
                          J Offline
                          jenya7
                          wrote on last edited by
                          #14

                          @JonB said in HTTP library:

                          @jenya7
                          This shows it is not missing any dependencies. So how do you think your application should know to find and load it from /home/pi/qhttp/xbin?

                          I have

                          LIBS += -L/home/pi/qhttp/xbin -lqhttp
                          

                          in pro file

                          piervalliP JonBJ 2 Replies Last reply
                          0
                          • J jenya7

                            @JonB said in HTTP library:

                            @jenya7
                            This shows it is not missing any dependencies. So how do you think your application should know to find and load it from /home/pi/qhttp/xbin?

                            I have

                            LIBS += -L/home/pi/qhttp/xbin -lqhttp
                            

                            in pro file

                            piervalliP Offline
                            piervalliP Offline
                            piervalli
                            wrote on last edited by
                            #15

                            @jenya7
                            Sorry, Why do you want use this library? I checked source code, httpclient does not use Qnetworkmanager but, it sends directly with QTcpSocket.

                            Thanks

                            J 1 Reply Last reply
                            0
                            • piervalliP piervalli

                              @jenya7
                              Sorry, Why do you want use this library? I checked source code, httpclient does not use Qnetworkmanager but, it sends directly with QTcpSocket.

                              Thanks

                              J Offline
                              J Offline
                              jenya7
                              wrote on last edited by jenya7
                              #16

                              @piervalli said in HTTP library:

                              @jenya7
                              Sorry, Why do you want use this library? I checked source code, httpclient does not use Qnetworkmanager but, it sends directly with QTcpSocket.

                              Thanks

                              I'm not tied to the lib. any lib I can include in my project without having a heart attack will go. do you have one to suggest?

                              1 Reply Last reply
                              0
                              • J jenya7

                                @JonB said in HTTP library:

                                @jenya7
                                This shows it is not missing any dependencies. So how do you think your application should know to find and load it from /home/pi/qhttp/xbin?

                                I have

                                LIBS += -L/home/pi/qhttp/xbin -lqhttp
                                

                                in pro file

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

                                @jenya7 said in HTTP library:

                                LIBS += -L/home/pi/qhttp/xbin -lqhttp

                                This tells the linker where to locate the libqhttp.a file while linking. I am not sure that it puts anything into the executable to tell it to look in that directory for the libqhttp.so file at runtime. See @jsulm's last post earlier on above.

                                J 1 Reply Last reply
                                0
                                • JonBJ JonB

                                  @jenya7 said in HTTP library:

                                  LIBS += -L/home/pi/qhttp/xbin -lqhttp

                                  This tells the linker where to locate the libqhttp.a file while linking. I am not sure that it puts anything into the executable to tell it to look in that directory for the libqhttp.so file at runtime. See @jsulm's last post earlier on above.

                                  J Offline
                                  J Offline
                                  jenya7
                                  wrote on last edited by
                                  #18

                                  @JonB said in HTTP library:

                                  @jenya7 said in HTTP library:

                                  LIBS += -L/home/pi/qhttp/xbin -lqhttp

                                  This tells the linker where to locate the libqhttp.a file while linking. I am not sure that it puts anything into the executable to tell it to look in that directory for the libqhttp.so file at runtime. See @jsulm's last post earlier on above.

                                  There is no libqhttp.so in Debug folder. I don't know how it's linked in run time.

                                  JonBJ jsulmJ 2 Replies Last reply
                                  0
                                  • J jenya7

                                    @JonB said in HTTP library:

                                    @jenya7 said in HTTP library:

                                    LIBS += -L/home/pi/qhttp/xbin -lqhttp

                                    This tells the linker where to locate the libqhttp.a file while linking. I am not sure that it puts anything into the executable to tell it to look in that directory for the libqhttp.so file at runtime. See @jsulm's last post earlier on above.

                                    There is no libqhttp.so in Debug folder. I don't know how it's linked in run time.

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

                                    @jenya7

                                    @JonB said in HTTP library:

                                    See @jsulm's last post earlier on above.

                                    1 Reply Last reply
                                    0
                                    • J Offline
                                      J Offline
                                      jenya7
                                      wrote on last edited by
                                      #20

                                      well...no luck with the lib. do we have something more user friendly?

                                      1 Reply Last reply
                                      0
                                      • J jenya7

                                        @JonB said in HTTP library:

                                        @jenya7 said in HTTP library:

                                        LIBS += -L/home/pi/qhttp/xbin -lqhttp

                                        This tells the linker where to locate the libqhttp.a file while linking. I am not sure that it puts anything into the executable to tell it to look in that directory for the libqhttp.so file at runtime. See @jsulm's last post earlier on above.

                                        There is no libqhttp.so in Debug folder. I don't know how it's linked in run time.

                                        jsulmJ Online
                                        jsulmJ Online
                                        jsulm
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #21

                                        @jenya7 said in HTTP library:

                                        There is no libqhttp.so in Debug folder

                                        I told you to copy it into your build folder - why don't you simply try that?

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

                                        J 1 Reply Last reply
                                        0
                                        • jsulmJ jsulm

                                          @jenya7 said in HTTP library:

                                          There is no libqhttp.so in Debug folder

                                          I told you to copy it into your build folder - why don't you simply try that?

                                          J Offline
                                          J Offline
                                          jenya7
                                          wrote on last edited by jenya7
                                          #22

                                          @jsulm said in HTTP library:

                                          @jenya7 said in HTTP library:

                                          There is no libqhttp.so in Debug folder

                                          I told you to copy it into your build folder - why don't you simply try that?

                                          I tried it of course. never ignore your suggestions :)

                                          jsulmJ 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