Qt6 Libcurl and Beaglebone black
-
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.
-
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.
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
-
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.
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 tolibcurl.so.4.8.0
. Perhaps start withfile /usr/lib/arm-linux-gnueabihf/libcurl*
-
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.
@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' :)
-
@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' :)
@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!
-