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.
  • L Offline
    L Offline
    Lee_Corl
    wrote on 15 Oct 2024, 01:32 last edited by
    #1

    12ed7d43-42ba-48d2-aebf-ffc47a0724ba-image.png What is this?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 15 Oct 2024, 01:51 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 J 2 Replies Last reply 15 Oct 2024, 02:53
      0
      • A aha_1980
        15 Oct 2024, 01:51

        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 15 Oct 2024, 02:53 last edited by
        #3

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

        1 Reply Last reply
        0
        • A aha_1980
          15 Oct 2024, 01:51

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

          Edit: Fixed -l

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 15 Oct 2024, 06:40 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

          A L 2 Replies Last reply 15 Oct 2024, 06:55
          0
          • J jsulm
            15 Oct 2024, 06:40

            @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"
            
            A Offline
            A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on 15 Oct 2024, 06:55 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
            • J jsulm
              15 Oct 2024, 06:40

              @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 15 Oct 2024, 11:43 last edited by
              #6

              @jsulm Windows

              J 1 Reply Last reply 15 Oct 2024, 12:02
              0
              • L Lee_Corl
                15 Oct 2024, 11:43

                @jsulm Windows

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 15 Oct 2024, 12:02 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 15 Oct 2024, 13:22
                0
                • J jsulm
                  15 Oct 2024, 12:02

                  @Lee_Corl Then fix the LIBS like I wrote

                  L Offline
                  L Offline
                  Lee_Corl
                  wrote on 15 Oct 2024, 13:22 last edited by
                  #8

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

                  J 1 Reply Last reply 15 Oct 2024, 13:34
                  0
                  • L Lee_Corl
                    15 Oct 2024, 13:22

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

                    J Offline
                    J Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 15 Oct 2024, 13:34 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 16 Oct 2024, 05:45
                    0
                    • J jsulm
                      15 Oct 2024, 13:34

                      @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 16 Oct 2024, 05:45 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

                      J 1 Reply Last reply 16 Oct 2024, 08:29
                      0
                      • L Lee_Corl
                        16 Oct 2024, 05:45

                        @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

                        J Offline
                        J Offline
                        JonB
                        wrote on 16 Oct 2024, 08:29 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 17 Oct 2024, 03:52
                        2
                        • J JonB
                          16 Oct 2024, 08:29

                          @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 17 Oct 2024, 03:52 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

                          4/12

                          15 Oct 2024, 06:40

                          topic:navigator.unread, 8
                          • Login

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