Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Include curl statically to Qt project
hi i trying to include curl to my project (static)
but no matter how i try.. i get the same error everytime
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)
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 ?
@SGaist i use qt mingw to build my custom build
@SGaist and also i can run application in debug mode becuse its doesn't even run
Bonnie last edited by
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?
@Bonnie i only want to send some https request to my site and get respond
can you show me some example of using Qnetwork
Bonnie last edited by Bonnie
You should looke at QNetworkAccessManager Class and HTTP Example.
The example uses
getmethod, you should change to
Also the post response data is normally not much, so you can skip the
readyReadpart and read all the data in
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.
@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?
Bonnie last edited by
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...
@Bonnie build static qt on windows was a pain 😅
i think its better for me use dynamic curl with openssl or winssl
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