Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt6 Libcurl and Beaglebone black
Forum Updated to NodeBB v4.3 + New Features

Qt6 Libcurl and Beaglebone black

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 4 Posters 682 Views
  • 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.
  • T Offline
    T Offline
    timroberts
    wrote on last edited by timroberts
    #1

    Hello,

    I'm attempting to port some software that was built in Qt 4.8 (Debian Wheezy) to Qt 6.4 on Debian Bookworm. I've successfully gotten a simple application to cross compile, and now I'm working on my objective.

    The problem I have is that the older software uses libcurl. I'm seeing posts about using QNetworkManager, but I'd really prefer having to reinvent the wheel so to speak and just use libcurl in this new version.

    The line in my .pro file that I have is

    LIBS += -L/usr/lib/arm-linux-gnueabihf -lcurl
    

    but I'm getting the error "cannot find -lcurl: No such file or directory".

    I have libcurl installed at $SYSROOT/usr/lib/arm-linux-gnueabihf/libcurl.so.4.8.0, so my question is: why is Qt not picking up on this? What am I missing?

    EDIT:
    I've put in this line into the .pro file:

    LIBS += -L/usr/lib/arm-linux-gnueabihf/libcurl.so.4.8.0
    

    instead of the previous line and it is accepted, however none of the curl functions (e.g. curl_easy_set_opt) are recognized at build time.

    aha_1980A JonBJ TomZT 3 Replies Last reply
    0
    • T timroberts

      Hello,

      I'm attempting to port some software that was built in Qt 4.8 (Debian Wheezy) to Qt 6.4 on Debian Bookworm. I've successfully gotten a simple application to cross compile, and now I'm working on my objective.

      The problem I have is that the older software uses libcurl. I'm seeing posts about using QNetworkManager, but I'd really prefer having to reinvent the wheel so to speak and just use libcurl in this new version.

      The line in my .pro file that I have is

      LIBS += -L/usr/lib/arm-linux-gnueabihf -lcurl
      

      but I'm getting the error "cannot find -lcurl: No such file or directory".

      I have libcurl installed at $SYSROOT/usr/lib/arm-linux-gnueabihf/libcurl.so.4.8.0, so my question is: why is Qt not picking up on this? What am I missing?

      EDIT:
      I've put in this line into the .pro file:

      LIBS += -L/usr/lib/arm-linux-gnueabihf/libcurl.so.4.8.0
      

      instead of the previous line and it is accepted, however none of the curl functions (e.g. curl_easy_set_opt) are recognized at build time.

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @timroberts

      your LIBS line is wrong, it must be -L<path> -l<file-without-leading-lib>

      also, have you checked for 32/64 bit problems?

      Regards

      Qt has to stay free or it will die.

      1 Reply Last reply
      0
      • T timroberts

        Hello,

        I'm attempting to port some software that was built in Qt 4.8 (Debian Wheezy) to Qt 6.4 on Debian Bookworm. I've successfully gotten a simple application to cross compile, and now I'm working on my objective.

        The problem I have is that the older software uses libcurl. I'm seeing posts about using QNetworkManager, but I'd really prefer having to reinvent the wheel so to speak and just use libcurl in this new version.

        The line in my .pro file that I have is

        LIBS += -L/usr/lib/arm-linux-gnueabihf -lcurl
        

        but I'm getting the error "cannot find -lcurl: No such file or directory".

        I have libcurl installed at $SYSROOT/usr/lib/arm-linux-gnueabihf/libcurl.so.4.8.0, so my question is: why is Qt not picking up on this? What am I missing?

        EDIT:
        I've put in this line into the .pro file:

        LIBS += -L/usr/lib/arm-linux-gnueabihf/libcurl.so.4.8.0
        

        instead of the previous line and it is accepted, however none of the curl functions (e.g. curl_easy_set_opt) are recognized at build time.

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

        @timroberts

        LIBS += -L/usr/lib/arm-linux-gnueabihf -lcurl
        

        This looks like the right line (your second attempt will do nothing, hence the error messages). It will need a libcurl.so in the directory, presumably as a soft link to libcurl.so.4.8.0. Perhaps start with

        file /usr/lib/arm-linux-gnueabihf/libcurl*
        
        1 Reply Last reply
        0
        • T timroberts

          Hello,

          I'm attempting to port some software that was built in Qt 4.8 (Debian Wheezy) to Qt 6.4 on Debian Bookworm. I've successfully gotten a simple application to cross compile, and now I'm working on my objective.

          The problem I have is that the older software uses libcurl. I'm seeing posts about using QNetworkManager, but I'd really prefer having to reinvent the wheel so to speak and just use libcurl in this new version.

          The line in my .pro file that I have is

          LIBS += -L/usr/lib/arm-linux-gnueabihf -lcurl
          

          but I'm getting the error "cannot find -lcurl: No such file or directory".

          I have libcurl installed at $SYSROOT/usr/lib/arm-linux-gnueabihf/libcurl.so.4.8.0, so my question is: why is Qt not picking up on this? What am I missing?

          EDIT:
          I've put in this line into the .pro file:

          LIBS += -L/usr/lib/arm-linux-gnueabihf/libcurl.so.4.8.0
          

          instead of the previous line and it is accepted, however none of the curl functions (e.g. curl_easy_set_opt) are recognized at build time.

          TomZT Offline
          TomZT Offline
          TomZ
          wrote on last edited by
          #4

          @timroberts said in Qt6 Libcurl and Beaglebone black:

          instead of the previous line and it is accepted, however none of the curl functions (e.g. curl_easy_set_opt) are recognized at build time.

          more modern build systems solve this in a less manual-labor process, qmake wasn't really made for these kind of projects.

          But you can likely make it work, and in this case I expect you've not added the path to the header files in your include path. Notice that this means you need to have the dev version of curl installed on debian-like systems where they split those.

          So, in short;

          apt install libcurl4-openssl-dev

          Either make sure all curl headers are included in curl/curl.h style, so with the leading dir, or add the curl dir itself to the include path. (probably /usr/include/arm-linux-gnueabihf/curl/ on your chosen distro).

          And last, add -lcurl and probably -lopenssl to your LIBS, but the other comments talked about that already.

          ps. when you solved this, please mark the topic as 'solved' :)

          T 1 Reply Last reply
          1
          • TomZT TomZ

            @timroberts said in Qt6 Libcurl and Beaglebone black:

            instead of the previous line and it is accepted, however none of the curl functions (e.g. curl_easy_set_opt) are recognized at build time.

            more modern build systems solve this in a less manual-labor process, qmake wasn't really made for these kind of projects.

            But you can likely make it work, and in this case I expect you've not added the path to the header files in your include path. Notice that this means you need to have the dev version of curl installed on debian-like systems where they split those.

            So, in short;

            apt install libcurl4-openssl-dev

            Either make sure all curl headers are included in curl/curl.h style, so with the leading dir, or add the curl dir itself to the include path. (probably /usr/include/arm-linux-gnueabihf/curl/ on your chosen distro).

            And last, add -lcurl and probably -lopenssl to your LIBS, but the other comments talked about that already.

            ps. when you solved this, please mark the topic as 'solved' :)

            T Offline
            T Offline
            timroberts
            wrote on last edited by
            #5

            @TomZ The issue(s) were the missing libcurl-openssl-dev library and then the incorrect links in the project file. With those issues resolved, the curl functions were recognized correctly.

            Thanks to everyone for the assistance!

            1 Reply Last reply
            1
            • T timroberts has marked this topic as solved on

            • Login

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