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.3k 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.
  • J Offline
    J Offline
    jenya7
    wrote on 19 Jan 2023, 07:49 last edited by
    #1

    I build the library as instructed

    # first clone this repository:
    $> git clone https://github.com/azadkuh/qhttp.git
    $> cd qhttp
    
    # prepare dependencies:
    $qhttp/> ./update-dependencies.sh
    
    # now build the library and the examples
    $qhttp/> qmake -r qhttp.pro
    $qhttp/> make -j 8
    

    Now I want to include it in my project (as I do with others libs)

    LIBS += -lqhttp
    

    And get
    error: cannot find -lqhttp

    How can I actually include the lib in the project?

    J 1 Reply Last reply 19 Jan 2023, 07:57
    0
    • J jenya7
      19 Jan 2023, 07:49

      I build the library as instructed

      # first clone this repository:
      $> git clone https://github.com/azadkuh/qhttp.git
      $> cd qhttp
      
      # prepare dependencies:
      $qhttp/> ./update-dependencies.sh
      
      # now build the library and the examples
      $qhttp/> qmake -r qhttp.pro
      $qhttp/> make -j 8
      

      Now I want to include it in my project (as I do with others libs)

      LIBS += -lqhttp
      

      And get
      error: cannot find -lqhttp

      How can I actually include the lib in the project?

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 19 Jan 2023, 07:57 last edited by
      #2

      @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
      

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

      J 1 Reply Last reply 19 Jan 2023, 08:14
      0
      • C Offline
        C Offline
        ChrisW67
        wrote on 19 Jan 2023, 08:07 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 19 Jan 2023, 08:36
        0
        • J jsulm
          19 Jan 2023, 07:57

          @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 19 Jan 2023, 08:14 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.

          J 1 Reply Last reply 19 Jan 2023, 08:30
          0
          • J jenya7
            19 Jan 2023, 08:14

            @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.

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 19 Jan 2023, 08:30 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 19 Jan 2023, 08:37
            0
            • C ChrisW67
              19 Jan 2023, 08:07

              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 19 Jan 2023, 08:36 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
              • J jsulm
                19 Jan 2023, 08:30

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

                J Offline
                J Offline
                jenya7
                wrote on 19 Jan 2023, 08:37 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 19 Jan 2023, 08:50 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 J 2 Replies Last reply 19 Jan 2023, 09:12
                  0
                  • J jenya7
                    19 Jan 2023, 08:50

                    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 19 Jan 2023, 09:12 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 19 Jan 2023, 09:41
                    0
                    • J jenya7
                      19 Jan 2023, 08:50

                      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

                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 19 Jan 2023, 09:21 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 19 Jan 2023, 09:40
                      0
                      • J jsulm
                        19 Jan 2023, 09:21

                        @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 19 Jan 2023, 09:40 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
                          19 Jan 2023, 09:12

                          @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 19 Jan 2023, 09:41 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 19 Jan 2023, 09:43
                          0
                          • J jenya7
                            19 Jan 2023, 09:41

                            @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 19 Jan 2023, 09:43 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 19 Jan 2023, 09:50
                            0
                            • JonBJ JonB
                              19 Jan 2023, 09:43

                              @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 19 Jan 2023, 09:50 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 19 Jan 2023, 09:57
                              0
                              • J jenya7
                                19 Jan 2023, 09:50

                                @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 19 Jan 2023, 09:57 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 19 Jan 2023, 10:03
                                0
                                • piervalliP piervalli
                                  19 Jan 2023, 09:57

                                  @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 19 Jan 2023, 10:03 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
                                    19 Jan 2023, 09:50

                                    @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 19 Jan 2023, 10:16 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 19 Jan 2023, 10:30
                                    0
                                    • JonBJ JonB
                                      19 Jan 2023, 10:16

                                      @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 19 Jan 2023, 10:30 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 J 2 Replies Last reply 19 Jan 2023, 10:55
                                      0
                                      • J jenya7
                                        19 Jan 2023, 10:30

                                        @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 19 Jan 2023, 10:55 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 19 Jan 2023, 13:24 last edited by
                                          #20

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

                                          1 Reply Last reply
                                          0

                                          1/29

                                          19 Jan 2023, 07:49

                                          • Login

                                          • Login or register to search.
                                          1 out of 29
                                          • First post
                                            1/29
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved