Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Chinese
  4. I have finished installing libcurl, but it is still illegal to use the curl_easy_init function.
Forum Updated to NodeBB v4.3 + New Features

I have finished installing libcurl, but it is still illegal to use the curl_easy_init function.

Scheduled Pinned Locked Moved Unsolved Chinese
12 Posts 4 Posters 1.1k 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.
  • aha_1980A Offline
    aha_1980A Offline
    aha_1980
    Lifetime Qt Champion
    wrote on last edited by aha_1980
    #2

    You don't link to the lib.
    Try LIBS += -lcurl in the .Pro file.

    Edit: Fixed -l

    Qt has to stay free or it will die.

    L jsulmJ 2 Replies Last reply
    0
    • aha_1980A aha_1980

      You don't link to the lib.
      Try LIBS += -lcurl in the .Pro file.

      Edit: Fixed -l

      L Offline
      L Offline
      Lee_Corl
      wrote on last edited by
      #3

      @aha_1980 6e7967ac-245a-406e-a424-b4566494e2d9-image.png this is my .pro file

      1 Reply Last reply
      0
      • aha_1980A aha_1980

        You don't link to the lib.
        Try LIBS += -lcurl in the .Pro file.

        Edit: Fixed -l

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by jsulm
        #4

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

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

        aha_1980A L 2 Replies Last reply
        0
        • jsulmJ jsulm

          @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"
          
          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #5

          @jsulm Thanks, that was indeed wrong. Probably because it was too early :)

          Qt has to stay free or it will die.

          1 Reply Last reply
          0
          • jsulmJ jsulm

            @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"
            
            L Offline
            L Offline
            Lee_Corl
            wrote on last edited by
            #6

            @jsulm Windows

            jsulmJ 1 Reply Last reply
            0
            • L Lee_Corl

              @jsulm Windows

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #7

              @Lee_Corl Then fix the LIBS like I wrote

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

              L 1 Reply Last reply
              0
              • jsulmJ jsulm

                @Lee_Corl Then fix the LIBS like I wrote

                L Offline
                L Offline
                Lee_Corl
                wrote on last edited by
                #8

                @jsulm 62de187b-c396-4088-a285-9571a5c94125-image.png What is your intention? However, this is still illegal.

                jsulmJ 1 Reply Last reply
                0
                • L Lee_Corl

                  @jsulm 62de187b-c396-4088-a285-9571a5c94125-image.png What is your intention? However, this is still illegal.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  @Lee_Corl Please read the link I gave you.
                  On Windows you link *.lib files like:

                  win32:LIBS += "C:/mylibs/extra libs/extra.lib"
                  

                  And please post text, not pictures...

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

                  L 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @Lee_Corl Please read the link I gave you.
                    On Windows you link *.lib files like:

                    win32:LIBS += "C:/mylibs/extra libs/extra.lib"
                    

                    And please post text, not pictures...

                    L Offline
                    L Offline
                    Lee_Corl
                    wrote on last edited by
                    #10

                    @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
                    

                    1e5c9df4-80b5-426a-839a-089c5bb5c4f4-image.png This is my path

                    JonBJ 1 Reply Last reply
                    0
                    • L Lee_Corl

                      @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
                      

                      1e5c9df4-80b5-426a-839a-089c5bb5c4f4-image.png This is my path

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

                      @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 shows ld 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 a vc17 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.

                      L 1 Reply Last reply
                      2
                      • JonBJ JonB

                        @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 shows ld 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 a vc17 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.

                        L Offline
                        L Offline
                        Lee_Corl
                        wrote on last edited by
                        #12

                        @JonB Finally, I chose Qt under Linux, which is convenient for Windows installation environment. Thank you

                        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