I have finished installing libcurl, but it is still illegal to use the curl_easy_init function.
-
You don't link to the lib.
TryLIBS += -lcurl
in the .Pro file.Edit: Fixed
-l
-
@aha_1980 said in I have finished installing libcurl, but it is still illegal to use the curl_easy_init function.:
LIBS += -Lcurl
It's
LIBS += -lcurl
@Lee_Corl Are you on Windows or Linux?
If on Windows then please take a look at documentation: https://doc.qt.io/qt-6/qmake-variable-reference.html#libs
Correct is (example):win32:LIBS += "C:/mylibs/extra libs/extra.lib"
-
@jsulm sorry,My intentions are still lawless, and libcurl's functions are still working.
#------------------------------------------------- # # Project created by QtCreator 2024-10-14T17:57:32 # #------------------------------------------------- QT += core gui LIBS += E:/Desktop/IoT_Parking_Lot/curl-8.10.1/builds/libcurl-vc17-x64-debug-dll-ipv6-sspi-schannel/lib/libcurl_debug.lib greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = IoT_Parking_Lot TEMPLATE = app # The following define makes your compiler emit warnings if you use # any feature of Qt which as been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += main.cpp\ mainwindow.cpp HEADERS += mainwindow.h FORMS += mainwindow.ui win32: LIBS += -L$$PWD/../curl-8.10.1/builds/libcurl-vc17-x64-debug-dll-ipv6-sspi-schannel/lib/ -llibcurl_debug win32:LIBS += "E:/Desktop/IoT_Parking_Lot/curl-8.10.1/builds/libcurl-vc17-x64-debug-dll-ipv6-sspi-schannel/lib/libcurl_debug.lib" INCLUDEPATH += $$PWD/../curl-8.10.1/builds/libcurl-vc17-x64-debug-dll-ipv6-sspi-schannel/include DEPENDPATH += $$PWD/../curl-8.10.1/builds/libcurl-vc17-x64-debug-dll-ipv6-sspi-schannel/include
This is my path
-
@Lee_Corl
If you had posted your original linking error as pasted text rather than screenshot this would all have been easier for us to see.
Your original screenshot showsld
being used as linker and complaining. That means you are using MinGW as your compiler/linker in your kit.
The curl library you are trying to link against is in avc17
directory and ends in.lib
. That means it has been compiled with MSVC.
You cannot mix MinGW and MSVC compiled code.
Either find or compile curl for MinGW, or change compiler of your Qt project to MSVC, or don't bother to use curl.