Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Include curl statically to Qt project
Forum Updated to NodeBB v4.3 + New Features

Include curl statically to Qt project

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 3 Posters 1.1k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    saeid0034
    wrote on last edited by saeid0034
    #1

    hi i trying to include curl to my project (static)
    but no matter how i try.. i get the same error everytime
    f698ea53-baf3-40d6-8e61-6957947ccb7e-image.png
    i test precompiled curl its make the program crash at start
    so i build it from source (with mingw) and also include openssl to it ( i use this command to build configure --disable-shared --without-zlib --without-libidn --without-librtmp --disable-ldap —-with-ssl=<path where my openssl is installed>
    but when i add new lib to my project its still give me above error
    anyone can show me a way to do this job?
    (or maybe show me a better way then curl)

    B 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you try to run your application in debug mode with the pre-built binary ?

      Are you sure your custom build uses the same architecture as your Qt version ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 2 Replies Last reply
      1
      • SGaistS SGaist

        Hi,

        Did you try to run your application in debug mode with the pre-built binary ?

        Are you sure your custom build uses the same architecture as your Qt version ?

        S Offline
        S Offline
        saeid0034
        wrote on last edited by
        #3

        @SGaist i use qt mingw to build my custom build

        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Did you try to run your application in debug mode with the pre-built binary ?

          Are you sure your custom build uses the same architecture as your Qt version ?

          S Offline
          S Offline
          saeid0034
          wrote on last edited by
          #4

          @SGaist and also i can run application in debug mode becuse its doesn't even run
          0b812ed7-cd14-45c4-b65a-f3e793617932-image.png

          1 Reply Last reply
          0
          • S saeid0034

            hi i trying to include curl to my project (static)
            but no matter how i try.. i get the same error everytime
            f698ea53-baf3-40d6-8e61-6957947ccb7e-image.png
            i test precompiled curl its make the program crash at start
            so i build it from source (with mingw) and also include openssl to it ( i use this command to build configure --disable-shared --without-zlib --without-libidn --without-librtmp --disable-ldap —-with-ssl=<path where my openssl is installed>
            but when i add new lib to my project its still give me above error
            anyone can show me a way to do this job?
            (or maybe show me a better way then curl)

            B Offline
            B Offline
            Bonnie
            wrote on last edited by
            #5

            @saeid0034 said in Include curl statically to Qt project:

            or maybe show me a better way then curl

            I think the better way is to use Qt Network module instead of curl if possible.
            What do you need curl for?

            S 1 Reply Last reply
            1
            • B Bonnie

              @saeid0034 said in Include curl statically to Qt project:

              or maybe show me a better way then curl

              I think the better way is to use Qt Network module instead of curl if possible.
              What do you need curl for?

              S Offline
              S Offline
              saeid0034
              wrote on last edited by
              #6

              @Bonnie i only want to send some https request to my site and get respond
              can you show me some example of using Qnetwork

              B 1 Reply Last reply
              0
              • S saeid0034

                @Bonnie i only want to send some https request to my site and get respond
                can you show me some example of using Qnetwork

                B Offline
                B Offline
                Bonnie
                wrote on last edited by Bonnie
                #7

                @saeid0034
                You should looke at QNetworkAccessManager Class and HTTP Example.
                The example uses get method, you should change to post.
                Also the post response data is normally not much, so you can skip the readyRead part and read all the data in httpFinished slot.

                Ah, I forgot to mention that Qt will try to load openssl dynamically to connect https.
                So you need to have openssl dynamic library binaries installed to your system or with your executable file.

                S 1 Reply Last reply
                2
                • B Bonnie

                  @saeid0034
                  You should looke at QNetworkAccessManager Class and HTTP Example.
                  The example uses get method, you should change to post.
                  Also the post response data is normally not much, so you can skip the readyRead part and read all the data in httpFinished slot.

                  Ah, I forgot to mention that Qt will try to load openssl dynamically to connect https.
                  So you need to have openssl dynamic library binaries installed to your system or with your executable file.

                  S Offline
                  S Offline
                  saeid0034
                  wrote on last edited by saeid0034
                  #8

                  @Bonnie thanks for reply
                  its give me this error qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
                  i build qt static and forgot to add -openssl-linked to build option
                  there is anyway for me to use it static now?

                  B 1 Reply Last reply
                  0
                  • S saeid0034

                    @Bonnie thanks for reply
                    its give me this error qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
                    i build qt static and forgot to add -openssl-linked to build option
                    there is anyway for me to use it static now?

                    B Offline
                    B Offline
                    Bonnie
                    wrote on last edited by
                    #9

                    @saeid0034
                    Well, surely you cannot use the static libraries without rebuild the static qt bacause the qt module needs it...
                    But maybe you can load the dynamic libraries? I'm not sure about that...

                    S 1 Reply Last reply
                    1
                    • B Bonnie

                      @saeid0034
                      Well, surely you cannot use the static libraries without rebuild the static qt bacause the qt module needs it...
                      But maybe you can load the dynamic libraries? I'm not sure about that...

                      S Offline
                      S Offline
                      saeid0034
                      wrote on last edited by
                      #10

                      @Bonnie build static qt on windows was a pain 😅
                      i think its better for me use dynamic curl with openssl or winssl

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        saeid0034
                        wrote on last edited by saeid0034
                        #11

                        anyone can help me to how use openssl in a project without need to build qt with openssl?
                        i think its beter to create new topic and ask this

                        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